codevibr

INSTRUCTIONS.md

Jun 7th, 2026
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.35 KB | None | 0 0
  1. # .agents/INSTRUCTIONS.md
  2.  
  3. # Project Timezone
  4.  
  5. For all dates, timestamps, changelog entries, session notes, troubleshooting records, and generated documentation:
  6.  
  7. Use America/New_York as the authoritative project timezone.
  8.  
  9. Do not use UTC.
  10.  
  11. Do not infer timezone from the execution environment.
  12.  
  13. If a timestamp is required, generate it using America/New_York local time.
  14.  
  15. # Purpose
  16.  
  17. You are working within a project that maintains a persistent agent knowledge system.
  18.  
  19. Before making changes, debugging issues, proposing architecture changes, or implementing features, you must consult the project knowledge base and use existing project knowledge whenever possible.
  20.  
  21. The goal is to:
  22.  
  23. - Reduce repeated repository exploration
  24. - Reduce repeated debugging of solved issues
  25. - Preserve architectural knowledge between sessions
  26. - Minimize token consumption caused by rediscovery
  27. - Create a single source of truth for project structure and decisions
  28. - Leave the project smarter than you found it
  29.  
  30. ---
  31.  
  32. # Required Directory Structure
  33.  
  34. ```
  35. .agents/
  36. ├── INSTRUCTIONS.md
  37. ├── project-map.md
  38. ├── architecture.md
  39. ├── routing.md
  40. ├── theme-overrides.md
  41. ├── troubleshooting.md
  42. ├── conventions.md
  43. ├── session-notes.md
  44. └── decisions.md
  45. ```
  46.  
  47. ---
  48.  
  49. # Agent Startup Requirements
  50.  
  51. Before performing any task, read:
  52.  
  53. 1. .agents/INSTRUCTIONS.md
  54. 2. .agents/project-map.md
  55. 3. .agents/troubleshooting.md
  56.  
  57. Additionally read:
  58.  
  59. - routing.md when modifying navigation, content, docs, blog, or pages
  60. - theme-overrides.md when modifying CSS or appearance
  61. - architecture.md when modifying layouts, components, plugins, or integrations
  62. - conventions.md when creating new content or code
  63. - decisions.md when evaluating alternatives or proposing architecture changes
  64.  
  65. Do not rediscover information already documented.
  66.  
  67. ---
  68.  
  69. # Knowledge Base Creation Requirements
  70.  
  71. Populate all knowledge-base documents using actual repository inspection.
  72.  
  73. Do not create placeholders.
  74.  
  75. Do not invent information.
  76.  
  77. When information cannot be verified, document:
  78.  
  79. UNKNOWN - Requires repository inspection
  80.  
  81. ---
  82.  
  83. # README Maintenance Policy
  84.  
  85. The repository README.md is the primary entry point for both humans and agents.
  86.  
  87. README.md should remain an accurate high-level description of the current project state.
  88.  
  89. Agents should treat README.md as living documentation rather than a one-time setup file.
  90.  
  91. ## Maintain README When
  92.  
  93. Review README.md whenever:
  94.  
  95. * Project architecture changes
  96.  
  97. * Routing changes
  98.  
  99. * Deployment changes
  100.  
  101. * Theme or plugin choices change
  102.  
  103. * Major project goals change
  104.  
  105. * New maintainer onboarding reveals documentation gaps
  106.  
  107. * Significant owner decisions affect project direction
  108.  
  109. ## README Responsibilities
  110.  
  111. README.md should describe:
  112.  
  113. * What the project is
  114.  
  115. * Why the project exists
  116.  
  117. * Major technologies in use
  118.  
  119. * Current architecture
  120.  
  121. * Content organization
  122.  
  123. * Deployment model
  124.  
  125. * Agent knowledge-base entry points
  126.  
  127. * Current project direction
  128.  
  129. * Important active limitations or known issues
  130.  
  131. README.md should not attempt to duplicate the full `.agents` knowledge base.
  132.  
  133. Instead, README.md should guide maintainers toward the relevant `.agents` documents.
  134.  
  135. ## Removing Stale Information
  136.  
  137. Agents should remove or update README content when it is no longer accurate.
  138.  
  139. Do not preserve outdated information solely for historical purposes.
  140.  
  141. Historical context belongs in:
  142.  
  143. * decisions.md
  144.  
  145. * session-notes.md
  146.  
  147. * troubleshooting.md
  148.  
  149. README.md should prioritize current truth over project history.
  150.  
  151. ## Owner Intent Preservation
  152.  
  153. When the project owner makes explicit decisions regarding:
  154.  
  155. * Site architecture
  156.  
  157. * Navigation structure
  158.  
  159. * Branding
  160.  
  161. * Design philosophy
  162.  
  163. * Documentation organization
  164.  
  165. * Deployment strategy
  166.  
  167. * Theme selection
  168.  
  169. those decisions should be reflected in README.md.
  170.  
  171. README.md should describe the intended direction of the project, not merely its current implementation.
  172.  
  173. ## New Maintainer Test
  174.  
  175. Periodically evaluate README.md using this question:
  176.  
  177. "If a new maintainer read only README.md, would they understand what this project is, how it is organized, where to start, and where to find deeper documentation?"
  178.  
  179. If the answer is no, improve README.md.
  180.  
  181. ## README Update Rule
  182.  
  183. Whenever a significant project discovery or owner decision is recorded in:
  184.  
  185. * decisions.md
  186.  
  187. * architecture.md
  188.  
  189. * routing.md
  190.  
  191. consider whether README.md should also be updated.
  192.  
  193. README.md should evolve alongside the project.
  194.  
  195. ---
  196.  
  197. # Project Map Requirements
  198.  
  199. Document:
  200.  
  201. - Astro version
  202. - Starlight configuration
  203. - Installed integrations
  204. - Installed plugins
  205. - Route structure
  206. - Content collections
  207. - CSS entry points
  208. - Theme override locations
  209. - Layout override locations
  210. - Important pages
  211. - Important components
  212. - Build and deployment information
  213.  
  214. Use relative paths only.
  215.  
  216. Never store machine-specific absolute paths.
  217.  
  218. ---
  219.  
  220. # Architecture Documentation
  221.  
  222. Document:
  223.  
  224. - Major layouts
  225. - Component hierarchy
  226. - Plugin interactions
  227. - Override mechanisms
  228. - Content flow
  229. - Build pipeline
  230. - Theme inheritance chain
  231.  
  232. Especially document:
  233.  
  234. - Astro
  235. - Starlight
  236. - starlight-blog
  237. - starlight-theme-terminal
  238.  
  239. ---
  240.  
  241. # Theme Override Documentation
  242.  
  243. For every intentional override document:
  244.  
  245. - Purpose
  246. - File location
  247. - Affected component
  248. - Original behavior
  249. - New behavior
  250. - Known side effects
  251.  
  252. ---
  253.  
  254. # CSS Documentation Standard
  255.  
  256. All non-trivial CSS overrides must contain adjacent documentation comments.
  257.  
  258. Comments should explain:
  259.  
  260. - What is being overridden
  261. - Why the override exists
  262. - What bug, conflict, or requirement caused it
  263. - Known side effects
  264. - Upgrade considerations
  265.  
  266. Comments should focus on WHY rather than WHAT.
  267.  
  268. Future maintainers can read CSS.
  269.  
  270. Future maintainers cannot read history.
  271.  
  272. Use this template:
  273.  
  274. ```
  275. /*
  276. Override: <short name>
  277.  
  278. Applies To:
  279. <component or page>
  280.  
  281. Reason:
  282. <why the override exists>
  283.  
  284. Reference:
  285. <troubleshooting.md section or decision>
  286.  
  287. Last Verified:
  288. <date>
  289.  
  290. Notes:
  291. <any upgrade concerns>
  292. */
  293. ```
  294.  
  295. ---
  296.  
  297. # CSS Override Philosophy
  298.  
  299. Prefer solutions in the following order:
  300.  
  301. 1. Local CSS overrides
  302. 2. Theme-level overrides
  303. 3. Theme source modifications
  304. 4. Starlight component overrides
  305. 5. Astro/Starlight source modifications
  306.  
  307. The objective is to maximize upgrade compatibility.
  308.  
  309. ---
  310.  
  311. # Terminal Theme Exception
  312.  
  313. The terminal theme is considered part of the project's customization layer.
  314.  
  315. Modifying starlight-theme-terminal is acceptable when:
  316.  
  317. - A CSS override is impractical
  318. - A theme-level change is significantly cleaner
  319. - The modification improves maintainability
  320.  
  321. Whenever modifying terminal theme files:
  322.  
  323. - Document the reason
  324. - Document affected files
  325. - Document upgrade impact
  326. - Update theme-overrides.md
  327. - Update session-notes.md
  328.  
  329. ---
  330.  
  331. # Before Modifying Framework Files
  332.  
  333. Before changing Astro or Starlight source files:
  334.  
  335. 1. Determine whether a CSS override can solve the issue
  336. 2. Determine whether a component override can solve the issue
  337. 3. Determine whether a theme-level modification can solve the issue
  338. 4. Document why those approaches are insufficient
  339.  
  340. Only then should framework files be modified.
  341.  
  342. Document the decision in decisions.md.
  343.  
  344. ---
  345.  
  346. # Override Preservation Policy
  347.  
  348. Existing overrides should be treated as intentional project knowledge.
  349.  
  350. Before removing, replacing, bypassing, or simplifying an override:
  351.  
  352. 1. Determine why the override exists
  353. 2. Search:
  354.  
  355. - theme-overrides.md
  356.  
  357. - troubleshooting.md
  358.  
  359. - decisions.md
  360.  
  361. - session-notes.md
  362. 3. Verify the original issue no longer exists
  363. 4. Document the reason for removal
  364. 5. Update relevant knowledge-base files
  365.  
  366. Never remove an override solely because its purpose is not immediately obvious.
  367.  
  368. Assume overrides exist for a reason until proven otherwise.
  369.  
  370. ---
  371.  
  372. # Evidence-Based Debugging Policy
  373.  
  374. Agents should prioritize evidence gathering over speculative fixes.
  375.  
  376. Before implementing a fix:
  377.  
  378. 1. Inspect the rendered output
  379. 2. Inspect generated DOM
  380. 3. Inspect pseudo-elements
  381. 4. Inspect computed styles
  382. 5. Identify the active selector
  383. 6. Identify the source stylesheet
  384. 7. Verify ownership
  385. 8. Then implement a fix
  386.  
  387. Avoid repeated speculative edits without identifying the active source of behavior.
  388.  
  389. The goal is to minimize token consumption caused by trial-and-error debugging.
  390.  
  391. ---
  392.  
  393. # CSS Debugging Workflow
  394.  
  395. Before changing CSS:
  396.  
  397. 1. Inspect rendered DOM
  398. 2. Inspect pseudo-elements
  399. 3. Inspect computed styles
  400. 4. Identify exact source selector
  401. 5. Identify source stylesheet
  402. 6. Verify ownership
  403. 7. Apply the minimal override necessary
  404. 8. Verify rendered result
  405.  
  406. Do not repeatedly guess CSS changes without identifying the active selector.
  407.  
  408. ---
  409.  
  410. # Layout Debugging Workflow
  411.  
  412. Before modifying layouts:
  413.  
  414. 1. Identify component source
  415. 2. Trace ownership chain
  416. 3. Trace route generation
  417. 4. Verify theme/plugin involvement
  418. 5. Then modify files
  419.  
  420. ---
  421.  
  422. # Plugin Debugging Workflow
  423.  
  424. Before modifying plugin behavior:
  425.  
  426. 1. Identify responsible plugin
  427. 2. Review plugin documentation
  428. 3. Review existing overrides
  429. 4. Inspect generated output
  430. 5. Then modify implementation
  431.  
  432. ---
  433.  
  434. # Troubleshooting Database Requirements
  435.  
  436. Every resolved issue should contain:
  437.  
  438. - Symptom
  439. - Root Cause
  440. - Resolution
  441. - Verification Method
  442. - Files Changed
  443.  
  444. Must include known issues such as:
  445.  
  446. ## Blog Tag Square Artifact
  447.  
  448. Symptom:
  449. Green square displayed before blog tags.
  450.  
  451. Root Cause:
  452. starlight-theme-terminal markdown list styling injected:
  453.  
  454. .sl-markdown-content ul:not(:where(.sl-steps, .not-content *)) > li::before
  455.  
  456. Resolution:
  457. Disable the pseudo-element for tag list items containing direct /blog/tags/ links.
  458.  
  459. Verification:
  460. Inspect DOM and confirm the tag list no longer renders the li::before marker.
  461.  
  462. ## Header Customization Conflict
  463.  
  464. Symptom:
  465. Terminal theme warning regarding Header override.
  466.  
  467. Root Cause:
  468. Terminal theme provides its own Header implementation.
  469.  
  470. Resolution:
  471. Extend or wrap the terminal Header implementation rather than replacing it outright.
  472.  
  473. ## Historical Evidence
  474.  
  475. When practical, include:
  476.  
  477. * Relevant commits
  478. * Relevant pull requests
  479. * Relevant files
  480. * Relevant documentation
  481.  
  482. to support troubleshooting entries.
  483.  
  484. ---
  485.  
  486. # Decisions Log Requirements
  487.  
  488. Maintain decisions.md.
  489.  
  490. For every major architectural decision record:
  491.  
  492. - Date
  493. - Decision
  494. - Alternatives considered
  495. - Reasoning
  496. - Outcome
  497.  
  498. Prevent future sessions from repeatedly revisiting settled decisions.
  499.  
  500. ---
  501.  
  502. # Session Notes Requirements
  503.  
  504. Maintain append-only session notes.
  505.  
  506. Each entry should contain:
  507.  
  508. - Date
  509. - Objective
  510. - Problem
  511. - Root Cause
  512. - Resolution
  513. - Files Changed
  514. - Follow-up Work
  515.  
  516. ---
  517.  
  518. # Conventions Documentation
  519.  
  520. Document:
  521.  
  522. - Naming conventions
  523. - File organization rules
  524. - CSS conventions
  525. - Override conventions
  526. - Content conventions
  527. - Markdown conventions
  528.  
  529. Future agents should follow documented conventions rather than inventing new ones.
  530.  
  531. ---
  532.  
  533. # Knowledge Maintenance Rules
  534.  
  535. After every successful fix:
  536.  
  537. 1. Update troubleshooting.md
  538. 2. Update theme-overrides.md if styling changed
  539. 3. Update architecture.md if structure changed
  540. 4. Add a session-notes entry
  541. 5. Record important discoveries
  542.  
  543. Knowledge capture is required work, not optional work.
  544.  
  545. ---
  546.  
  547. # Future Agent Efficiency
  548.  
  549. - Always read `.agents/INSTRUCTIONS.md`, `.agents/project-map.md`, and `.agents/troubleshooting.md` before working.
  550. - For routing/content changes, read `.agents/routing.md` first.
  551. - For CSS/theme changes, read `.agents/theme-overrides.md` first and inspect the rendered DOM before editing.
  552. - For Header/Footer/plugin work, read `.agents/architecture.md` and `.agents/decisions.md` first.
  553. - Run `npm run build` after meaningful changes; compare warnings against `troubleshooting.md`.
  554. - For CSS-sensitive verification, use freshly generated output or restart the dev server before trusting rendered CSS. Past work found `npm run dev` did not always regenerate CSS changes reliably.
  555. - When serving `dist/` with a manually started static server, verify the server after launch with actual HTTP requests to `/` and at least one nested route such as `/docs/`. Do not treat a background process start as proof the site remains available. In sandboxed sessions, background servers may be cleaned up after the shell command exits; if immediate checks pass but later requests are refused, request approval to start the server outside the sandbox and verify again after a short delay.
  556. - When the owner needs to see the custom `404.html` through an actual missing URL, do not use plain `python -m http.server`: it returns Python's default directory 404 instead of the built Astro page. Start a small `SimpleHTTPRequestHandler` subclass from `dist/` that overrides `send_error(404)` to return `404.html` while preserving HTTP status `404`.
  557. - Persistent preview servers should be started outside the sandbox with `require_escalated`; sandboxed `Start-Process` launches can exit or be cleaned up even when the command appears to start.
  558. - After starting a preview server, verify persistence with `Get-NetTCPConnection -LocalPort <port>` and verify missing-route behavior with `curl.exe`, not only `Invoke-WebRequest`. `Invoke-WebRequest` throws for intentional 404 responses, which can make verification look failed even when the custom 404 server is running correctly.
  559. - Update `.agents` during the same session as any fix so future agents do not repeat discovery.
  560. - Session notes are temporary working memory. Once an issue is resolved, its final conclusions must be migrated into the appropriate architectural document and removed from session-notes.md.
  561.  
  562. ---
  563.  
  564. # Success Criteria
  565.  
  566. A brand-new agent should be able to:
  567.  
  568. - Understand project architecture
  569. - Understand routing
  570. - Understand customizations
  571. - Understand theme behavior
  572. - Understand previously solved bugs
  573. - Understand project conventions
  574. - Understand prior architectural decisions
  575.  
  576. without rediscovering information from scratch.
  577.  
  578. ---
  579.  
  580. # Task Completion Metrics
  581.  
  582. Report any available metrics, including:
  583.  
  584. - Duration
  585. - Files inspected
  586. - Knowledge-base files updated
  587. - Documentation files created
  588. - Application files modified
  589. - External sources consulted
  590. - Available runtime metrics
  591.  
  592. Only report metrics actually provided by the runtime.
  593.  
  594. Do not estimate unavailable metrics.
  595.  
Advertisement
Add Comment
Please, Sign In to add comment