[{"data":1,"prerenderedAt":371},["ShallowReactive",2],{"doc-features\u002Fpragma-rules":3,"content-query-q0zxUGiHMn":4},null,{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"body":11,"_type":365,"_id":366,"_source":367,"_file":368,"_stem":369,"_extension":370},"\u002Fdocs\u002Ffeatures\u002Fpragma-rules","features",false,"","Pragma Agent Rules","Learn how Pragma agent rules steer Comp, when they apply, and how to write useful rules.",{"type":12,"children":13,"toc":354},"root",[14,22,39,45,58,65,70,110,115,121,126,144,149,155,178,185,264,270,311,317],{"type":15,"tag":16,"props":17,"children":19},"element","h1",{"id":18},"pragma-agent-rules",[20],{"type":21,"value":9},"text",{"type":15,"tag":23,"props":24,"children":29},"div",{"className":25,"ariaHidden":28},[26,27],"docs-page-hero","docs-page-hero--sage","true",[30,32],{"type":21,"value":31},"\n  ",{"type":15,"tag":33,"props":34,"children":38},"img",{"src":35,"alt":8,"width":36,"height":37},"\u002Fimages\u002Fdocs-illustrations\u002Fpragma-rules.svg",128,72,[],{"type":15,"tag":40,"props":41,"children":42},"p",{},[43],{"type":21,"value":44},"Rules tell Comp \u002F the Pragma AI agent how to behave in your workspace. They are durable preferences — coding style, safety constraints, project conventions — that should apply across conversations.",{"type":15,"tag":40,"props":46,"children":47},{},[48,50,56],{"type":21,"value":49},"Manage rules from ",{"type":15,"tag":51,"props":52,"children":53},"strong",{},[54],{"type":21,"value":55},"Settings → AI",{"type":21,"value":57}," (Rules section).",{"type":15,"tag":59,"props":60,"children":62},"h2",{"id":61},"what-a-rule-is",[63],{"type":21,"value":64},"What A Rule Is",{"type":15,"tag":40,"props":66,"children":67},{},[68],{"type":21,"value":69},"A rule is a short instruction the agent should follow, for example:",{"type":15,"tag":71,"props":72,"children":73},"ul",{},[74,80,94,99],{"type":15,"tag":75,"props":76,"children":77},"li",{},[78],{"type":21,"value":79},"Prefer TypeScript over JavaScript in this repo",{"type":15,"tag":75,"props":81,"children":82},{},[83,85,92],{"type":21,"value":84},"Never commit ",{"type":15,"tag":86,"props":87,"children":89},"code",{"className":88},[],[90],{"type":21,"value":91},".env",{"type":21,"value":93}," files",{"type":15,"tag":75,"props":95,"children":96},{},[97],{"type":21,"value":98},"Ask before running destructive shell commands",{"type":15,"tag":75,"props":100,"children":101},{},[102,104],{"type":21,"value":103},"Follow the existing component patterns in ",{"type":15,"tag":86,"props":105,"children":107},{"className":106},[],[108],{"type":21,"value":109},"frontend\u002F",{"type":15,"tag":40,"props":111,"children":112},{},[113],{"type":21,"value":114},"Rules are not a replacement for secrets management or access control. They guide behavior; they do not replace permissions.",{"type":15,"tag":59,"props":116,"children":118},{"id":117},"when-rules-apply",[119],{"type":21,"value":120},"When Rules Apply",{"type":15,"tag":40,"props":122,"children":123},{},[124],{"type":21,"value":125},"Rules typically apply when:",{"type":15,"tag":71,"props":127,"children":128},{},[129,134,139],{"type":15,"tag":75,"props":130,"children":131},{},[132],{"type":21,"value":133},"You start or continue an agent conversation in that workspace",{"type":15,"tag":75,"props":135,"children":136},{},[137],{"type":21,"value":138},"The agent plans edits, commands, or reviews",{"type":15,"tag":75,"props":140,"children":141},{},[142],{"type":21,"value":143},"Project conventions matter more than a one-off prompt",{"type":15,"tag":40,"props":145,"children":146},{},[147],{"type":21,"value":148},"If a prompt conflicts with a rule, treat rules as standing policy and clarify in the conversation when you intentionally override them.",{"type":15,"tag":59,"props":150,"children":152},{"id":151},"how-to-write-good-rules",[153],{"type":21,"value":154},"How To Write Good Rules",{"type":15,"tag":71,"props":156,"children":157},{},[158,163,168,173],{"type":15,"tag":75,"props":159,"children":160},{},[161],{"type":21,"value":162},"Keep each rule specific and testable",{"type":15,"tag":75,"props":164,"children":165},{},[166],{"type":21,"value":167},"Prefer “do \u002F don’t” language over vague goals",{"type":15,"tag":75,"props":169,"children":170},{},[171],{"type":21,"value":172},"Separate style rules from safety rules",{"type":15,"tag":75,"props":174,"children":175},{},[176],{"type":21,"value":177},"Update rules when the project conventions change",{"type":15,"tag":179,"props":180,"children":182},"h3",{"id":181},"examples",[183],{"type":21,"value":184},"Examples",{"type":15,"tag":186,"props":187,"children":188},"table",{},[189,208],{"type":15,"tag":190,"props":191,"children":192},"thead",{},[193],{"type":15,"tag":194,"props":195,"children":196},"tr",{},[197,203],{"type":15,"tag":198,"props":199,"children":200},"th",{},[201],{"type":21,"value":202},"Good rule",{"type":15,"tag":198,"props":204,"children":205},{},[206],{"type":21,"value":207},"Why it helps",{"type":15,"tag":209,"props":210,"children":211},"tbody",{},[212,226,245],{"type":15,"tag":194,"props":213,"children":214},{},[215,221],{"type":15,"tag":216,"props":217,"children":218},"td",{},[219],{"type":21,"value":220},"Use pnpm, not npm, in this repo",{"type":15,"tag":216,"props":222,"children":223},{},[224],{"type":21,"value":225},"Prevents wrong package manager commands",{"type":15,"tag":194,"props":227,"children":228},{},[229,240],{"type":15,"tag":216,"props":230,"children":231},{},[232,234],{"type":21,"value":233},"Ask before ",{"type":15,"tag":86,"props":235,"children":237},{"className":236},[],[238],{"type":21,"value":239},"git push --force",{"type":15,"tag":216,"props":241,"children":242},{},[243],{"type":21,"value":244},"Safety for shared branches",{"type":15,"tag":194,"props":246,"children":247},{},[248,259],{"type":15,"tag":216,"props":249,"children":250},{},[251,253],{"type":21,"value":252},"Match existing Vue SFC structure in ",{"type":15,"tag":86,"props":254,"children":256},{"className":255},[],[257],{"type":21,"value":258},"frontend\u002Fapp",{"type":15,"tag":216,"props":260,"children":261},{},[262],{"type":21,"value":263},"Keeps diffs consistent",{"type":15,"tag":59,"props":265,"children":267},{"id":266},"what-users-should-know",[268],{"type":21,"value":269},"What Users Should Know",{"type":15,"tag":271,"props":272,"children":273},"ol",{},[274,279,284,298],{"type":15,"tag":75,"props":275,"children":276},{},[277],{"type":21,"value":278},"Rules improve consistency across sessions.",{"type":15,"tag":75,"props":280,"children":281},{},[282],{"type":21,"value":283},"Too many vague rules confuse the agent — fewer clear rules work better.",{"type":15,"tag":75,"props":285,"children":286},{},[287,289,296],{"type":21,"value":288},"Pair rules with ",{"type":15,"tag":290,"props":291,"children":293},"a",{"href":292},"\u002Fdocs\u002Ffeatures\u002Fpragma-codebase-context",[294],{"type":21,"value":295},"codebase context",{"type":21,"value":297}," so the agent sees the right files.",{"type":15,"tag":75,"props":299,"children":300},{},[301,303,309],{"type":21,"value":302},"For tool access, configure ",{"type":15,"tag":290,"props":304,"children":306},{"href":305},"\u002Fdocs\u002Ffeatures\u002Fpragma-mcp",[307],{"type":21,"value":308},"MCP servers",{"type":21,"value":310}," separately.",{"type":15,"tag":59,"props":312,"children":314},{"id":313},"related-pages",[315],{"type":21,"value":316},"Related Pages",{"type":15,"tag":71,"props":318,"children":319},{},[320,329,337,345],{"type":15,"tag":75,"props":321,"children":322},{},[323],{"type":15,"tag":290,"props":324,"children":326},{"href":325},"\u002Fdocs\u002Ffeatures\u002Fpragma-ai-agent",[327],{"type":21,"value":328},"Pragma AI Agent",{"type":15,"tag":75,"props":330,"children":331},{},[332],{"type":15,"tag":290,"props":333,"children":334},{"href":292},[335],{"type":21,"value":336},"Codebase Context",{"type":15,"tag":75,"props":338,"children":339},{},[340],{"type":15,"tag":290,"props":341,"children":342},{"href":305},[343],{"type":21,"value":344},"Pragma MCP Servers",{"type":15,"tag":75,"props":346,"children":347},{},[348],{"type":15,"tag":290,"props":349,"children":351},{"href":350},"\u002Fdocs\u002Ffeatures\u002Fpragma-settings",[352],{"type":21,"value":353},"Pragma Settings",{"title":8,"searchDepth":355,"depth":355,"links":356},2,[357,358,359,363,364],{"id":61,"depth":355,"text":64},{"id":117,"depth":355,"text":120},{"id":151,"depth":355,"text":154,"children":360},[361],{"id":181,"depth":362,"text":184},3,{"id":266,"depth":355,"text":269},{"id":313,"depth":355,"text":316},"markdown","content:docs:features:pragma-rules.md","content","docs\u002Ffeatures\u002Fpragma-rules.md","docs\u002Ffeatures\u002Fpragma-rules","md",1791370284133]