home / skills / oimiragieo / agent-studio / context-files-rules

This skill helps enforce and improve context file guidelines across project docs, ensuring stable master context and well-documented changes.

npx playbooks add skill oimiragieo/agent-studio --skill context-files-rules

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
2.3 KB
---
name: context-files-rules
description: Specifies rules for managing context files, including the master project context and supplementary files, emphasizing stability and change management.
version: 1.0.0
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit]
globs: '**/ProjectDocs/contexts/**/*'
best_practices:
  - Follow the guidelines consistently
  - Apply rules during code review
  - Use as reference when writing new code
error_handling: graceful
streaming: supported
---

# Context Files Rules Skill

<identity>
You are a coding standards expert specializing in context files rules.
You help developers write better code by applying established guidelines and best practices.
</identity>

<capabilities>
- Review code for guideline compliance
- Suggest improvements based on best practices
- Explain why certain patterns are preferred
- Help refactor code to meet standards
</capabilities>

<instructions>
When reviewing or writing code, apply these guidelines:

- **Master Project Context (`projectContext.md`):**
  - Located in `/ProjectDocs/contexts/`.
  - Provides the overarching project scope, requirements, and design principles.
  - Only update this file if there are major changes to the project’s fundamental direction or scope.
- **Additional Context Files:**
  - Supplementary files (e.g., `uiContext.md`, `featureAContext.md`) may be created for more detailed specifications on certain functionalities, designs, or areas of the application.
  - Keep these files stable. Update them only when new, approved changes need to be documented.
  - Reference these files frequently to ensure development aligns with established guidelines.
- **Change Management:**
  - Record any changes to context files within the corresponding build notes file for that task.
  - Maintain a clear rationale for context changes to preserve transparency and alignment with the core project goals.
    </instructions>

<examples>
Example usage:
```
User: "Review this code for context files rules compliance"
Agent: [Analyzes code against guidelines and provides specific feedback]
```
</examples>

## Memory Protocol (MANDATORY)

**Before starting:**

```bash
cat .claude/context/memory/learnings.md
```

**After completing:** Record any new patterns or exceptions discovered.

> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

Overview

This skill defines rules for managing context files, centered on a single master project context and supporting supplemental files. It enforces stability, clear change management, and traceable rationale for edits. The aim is to keep high-level direction stable while allowing controlled, documented refinements where needed.

How this skill works

The skill inspects repository structure and context file usage to verify that a single master context exists at /ProjectDocs/contexts/projectContext.md and that supplementary context files are used appropriately. It checks whether updates were justified, recorded in task build notes, and aligned with project scope. It also enforces a memory protocol: check current learnings before work and record new patterns or exceptions afterward.

When to use it

  • Onboarding a new feature or team to ensure alignment with project scope
  • Before accepting changes that affect requirements, design, or fundamental direction
  • During code reviews to verify compliance with context file rules
  • When creating or updating supplementary context files for specific areas
  • When auditing documentation stability and change history

Best practices

  • Keep the master project context authoritative and update it only for major scope or direction changes
  • Create supplementary context files for focused specifications and keep them stable unless approved changes occur
  • Always document the rationale for any context change in the build notes associated with the task
  • Reference the appropriate context files in design and implementation decisions to maintain alignment
  • Follow the memory protocol: review existing learnings before starting and record new patterns or exceptions after finishing

Example use cases

  • Review a pull request that touches multiple modules to ensure implementations follow projectContext.md
  • Create uiContext.md for UI components and link decisions back to the master context
  • Audit supplementary context files to confirm they were updated only when approved and that build notes explain changes
  • Refactor a feature to align with documented design principles in featureAContext.md and record the rationale in build notes

FAQ

When should the master project context be updated?

Only when there are major, approved changes to the project’s fundamental direction, scope, or core requirements.

Where should change rationale be recorded?

Record the rationale and details of any context-file change in the corresponding build notes for the task so the history is traceable and reviewable.