Skip to content

docs: update copilot rules - #50

Merged
loadinglucian merged 2 commits into
mainfrom
docs/copilot-rules
Oct 24, 2025
Merged

docs: update copilot rules#50
loadinglucian merged 2 commits into
mainfrom
docs/copilot-rules

Conversation

@loadinglucian

@loadinglucian loadinglucian commented Oct 24, 2025

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Documentation
    • Reorganized rules into a formal, sectioned structure (mission, execution protocol, tests) and made compliance statements explicit.
    • Consolidated and standardized architecture and command guidance, shifting command docs toward modern prompt-based patterns.
    • Updated test guideline phrasing and examples.
    • Added mandatory Bash style and non-interactive playbook guides.
    • Introduced standardized rule-writing standards for consistency and token-efficient docs.

@coderabbitai

coderabbitai Bot commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Restructures and expands .cursor/rules/ documentation: converts narrative guidance into mandatory, sectioned policies; reorganizes architecture and command guidance (favoring Laravel Prompts and BaseCommand); and adds three new rule files for bash style, playbooks, and meta-guidance for authoring rule documents.

Changes

Cohort / File(s) Summary
Core Rule Reorganization
​.cursor/rules/00-main.mdc, ​.cursor/rules/01-architecture.mdc, ​.cursor/rules/02-tests.mdc, ​.cursor/rules/03-commands.mdc
Rewrites existing rule documents into formal, action-oriented sections. Converts prose to mandatory checklist language; architecture rules refocused on PHP standards and explicit use-statement/DI conventions; tests receive phrasing and example tweaks; commands rewritten to prioritize BaseCommand patterns and Laravel Prompts usage.
New Bash and Playbook Guides
​.cursor/rules/04-bash-style.mdc, ​.cursor/rules/05-playbooks.mdc
Adds comprehensive Bash style rules (syntax, parameter handling, error handling, formatting) and detailed idempotent, non-interactive playbook guidance with examples, environment conventions, and recovery patterns.
Rule Documentation Meta-Guide
​.cursor/rules/rules.mdc
New meta-rule file establishing token-efficiency principles, file structure standards, section organization, cross-file coordination rules, maintenance checklist, and anti-patterns for authoring rule documents aimed at AI agents.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • bigpixelrocket/deployer-php#12 — Overlapping edits to .cursor/rules/* documentation; likely touches the same files and restructuring approach.
  • bigpixelrocket/deployer-php#20 — Related modifications to command guidance, specifically BaseCommand and Laravel Prompts integration in .cursor/rules/03-commands.mdc.

Poem

🐇 I hopped through lines of rule and rhyme,

Trimmed prose to checklists, neat each time.
Bash and playbooks, tidy and bright,
Prompts for commands, all set just right.
A rabbit's nibble made docs light. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "docs: update copilot rules" directly and accurately describes the primary change in the changeset. All modifications are contained within the .cursor/rules/ directory, which comprises AI agent guidance documentation. The changes include restructuring and updating existing rules files (00-main.mdc through 03-commands.mdc) and introducing new rule documentation files (04-bash-style.mdc, 05-playbooks.mdc, and rules.mdc). The title is concise, clear, uses standard documentation convention with the "docs:" prefix, and provides sufficient context for someone scanning commit history to understand the nature of the changes.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6878bf0 and 7faf705.

📒 Files selected for processing (1)
  • .cursor/rules/00-main.mdc (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.cursor/rules/02-tests.mdc (1)

1-159: Helper function mockCommandContainer() prescribed but not implemented; TestHelpers.php missing.

The document extensively prescribes mockCommandContainer() at lines 31, 37-72 with detailed usage examples and maintenance patterns. However, verification confirms:

  • mockCommandContainer() does not exist in the codebase
  • TestHelpers.php does not exist
  • tests/ directory contains only: Pest.php, TestCase.php, Integration/, .gitignore

The IOService methods (promptText, promptPassword, etc.) verified successfully in app/Services/IOService.php. However, the core testing helper infrastructure referenced throughout the rules is unimplemented, making the prescribed patterns (lines 31-72) non-functional as written.

Either implement tests/TestHelpers.php with mockCommandContainer() matching the prescribed signature, or rewrite the rules section to reflect actual testing patterns currently in use.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a9c162 and 6878bf0.

📒 Files selected for processing (7)
  • .cursor/rules/00-main.mdc (1 hunks)
  • .cursor/rules/01-architecture.mdc (2 hunks)
  • .cursor/rules/02-tests.mdc (2 hunks)
  • .cursor/rules/03-commands.mdc (7 hunks)
  • .cursor/rules/04-bash-style.mdc (1 hunks)
  • .cursor/rules/05-playbooks.mdc (1 hunks)
  • .cursor/rules/rules.mdc (1 hunks)
🧰 Additional context used
🧠 Learnings (22)
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to tests/**/*.php : Avoid meaningless assertions (type-only checks, generic truthiness/nullness, sleeping; use time mocking)

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to tests/**/*.php : Use Pest exclusively with it() syntax for all tests

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to tests/**/*.php : Follow the AAA pattern (Arrange, Act, Assert) in all tests; add Cleanup when needed

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to tests/**/*.php : Prefer meaningful assertions invoking real behavior (config values, validators, mocks with expectations)

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to tests/**/*.php : Keep test files minimal: target under 1.8x the size of the source they cover without sacrificing readability

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-10T11:09:41.980Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/01-architecture.mdc:0-0
Timestamp: 2025-10-10T11:09:41.980Z
Learning: Applies to tests/**/*.php : In tests, direct Container instantiation and bind() for mocks is allowed and encouraged for isolation

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to tests/**/*.php : Unit tests: mock all external dependencies, test single units, run in milliseconds

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to tests/**/*.php : Ignore PHPStan issues in tests; focus on test functionality over strict types

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-10T11:09:41.980Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/01-architecture.mdc:0-0
Timestamp: 2025-10-10T11:09:41.980Z
Learning: Applies to tests/**/*.php : Do not run PHPStan on test files; tests are excluded from static analysis

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to src/**/*.php : Run and apply PHPStan to production code

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to tests/**/*.php : Avoid excessive phpdoc in tests solely to appease types

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:50:03.841Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/02-tests.mdc:0-0
Timestamp: 2025-10-12T15:50:03.841Z
Learning: Applies to tests/**/*.php : Avoid performance tests unless performance is the primary concern

Applied to files:

  • .cursor/rules/02-tests.mdc
📚 Learning: 2025-10-12T15:51:30.263Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/03-commands.mdc:0-0
Timestamp: 2025-10-12T15:51:30.263Z
Learning: Applies to app/Console/**/*Command.php : Define command inputs using OPTIONS only, never ARGUMENTS, to enable getOptionOrPrompt pattern

Applied to files:

  • .cursor/rules/03-commands.mdc
📚 Learning: 2025-10-12T15:51:30.263Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/03-commands.mdc:0-0
Timestamp: 2025-10-12T15:51:30.263Z
Learning: Applies to app/Console/**/*Command.php : Use laravel/prompts for all user interactions (text, password, confirm, select, multiselect, suggest, search, spin)

Applied to files:

  • .cursor/rules/03-commands.mdc
📚 Learning: 2025-10-12T15:51:30.263Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/03-commands.mdc:0-0
Timestamp: 2025-10-12T15:51:30.263Z
Learning: Applies to app/Console/**/*Command.php : Pair every defined option with getOptionOrPrompt to provide both CLI and interactive flows

Applied to files:

  • .cursor/rules/03-commands.mdc
📚 Learning: 2025-10-12T15:51:30.263Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/03-commands.mdc:0-0
Timestamp: 2025-10-12T15:51:30.263Z
Learning: Applies to app/Console/**/*Command.php : Support both interactive prompts and CLI options using getOptionOrPrompt(optionName, promptCallback) for dual-mode commands

Applied to files:

  • .cursor/rules/03-commands.mdc
📚 Learning: 2025-10-12T15:51:30.263Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/03-commands.mdc:0-0
Timestamp: 2025-10-12T15:51:30.263Z
Learning: Applies to app/Console/**/*Command.php : Follow option naming conventions: --server/--site for selecting existing resources; --name for defining new resource; --host, --port for server config; --yes/-y for confirmations; --skip to bypass validation

Applied to files:

  • .cursor/rules/03-commands.mdc
📚 Learning: 2025-10-12T15:51:30.263Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/03-commands.mdc:0-0
Timestamp: 2025-10-12T15:51:30.263Z
Learning: Applies to app/Console/**/*Command.php : Use getValidatedOptionOrPrompt for inputs that require validation; inject validator once and reuse for prompts and options

Applied to files:

  • .cursor/rules/03-commands.mdc
📚 Learning: 2025-10-12T15:51:30.263Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/03-commands.mdc:0-0
Timestamp: 2025-10-12T15:51:30.263Z
Learning: Applies to app/Traits/ConsoleInputTrait.php : Add input-gathering methods (promptText, promptSelect, etc.) to ConsoleInputTrait; methods should operate via $this->input

Applied to files:

  • .cursor/rules/03-commands.mdc
📚 Learning: 2025-10-12T15:51:30.263Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/03-commands.mdc:0-0
Timestamp: 2025-10-12T15:51:30.263Z
Learning: Applies to app/Console/**/*Command.php : Always call showCommandHint() before returning Command::SUCCESS to display non-interactive usage

Applied to files:

  • .cursor/rules/03-commands.mdc
📚 Learning: 2025-10-10T11:09:41.980Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/01-architecture.mdc:0-0
Timestamp: 2025-10-10T11:09:41.980Z
Learning: Applies to **/*.php : Use comments as visual separators for sections/subsections with a single newline between header, subheader, and paragraph; avoid obvious or stale comments

Applied to files:

  • .cursor/rules/01-architecture.mdc
📚 Learning: 2025-10-01T19:31:44.869Z
Learnt from: CR
PR: bigpixelrocket/deployer-php#0
File: .cursor/rules/00-main.mdc:0-0
Timestamp: 2025-10-01T19:31:44.869Z
Learning: Applies to **/*.php : Organize code into comment-separated sections; prefer alphabetical ordering when it does not conflict with logical grouping

Applied to files:

  • .cursor/rules/01-architecture.mdc
🔇 Additional comments (5)
.cursor/rules/04-bash-style.mdc (1)

1-116: Style guide content is comprehensive; verify external reference currency.

The Bash style guidelines are well-structured and provide clear examples. Confirm the external style guide reference at line 7 (https://style.ysap.sh/md) is still current and accessible, and verify that the formatting standards (tabs, 80-column width) align with project tooling.

.cursor/rules/rules.mdc (1)

127-143: Rule density guidelines established; verify file compliance.

The token efficiency and rule density guidelines are clearly defined. However, review whether the rule files in this PR comply with stated targets:

  • 02-tests.mdc: ~159 lines (target 80-120) — exceeds by ~39 lines
  • 00-main.mdc: ~54 lines (target 30-50) — within range
  • 01-architecture.mdc: ~134 lines (target 80-120) — exceeds by ~14 lines
  • 03-commands.mdc: ~237 lines (target 180-220) — exceeds by ~17 lines
  • 04-bash-style.mdc: ~116 lines (target 60-100) — exceeds by ~16 lines
  • 05-playbooks.mdc: ~152 lines (target 100-140) — exceeds by ~12 lines

Consider whether these overages are acceptable given content density, or if further condensing per the anti-patterns guidance (lines 92-125) is warranted.

.cursor/rules/03-commands.mdc (2)

166-210: All referenced files exist and cross-references are valid. Verification confirms that ServerValidationTrait.php, SiteValidationTrait.php, ServerDeleteCommand.php, and ServerAddCommand.php are present in the codebase at their documented locations (app/Traits/ and app/Console/Server/). The documentation examples maintain accurate references.


31-37: The referenced trait files (ConsoleOutputTrait.php and ConsoleInputTrait.php) do not exist in the codebase.

All listed methods are implemented in IOService.php (app/Services/IOService.php), not in separate traits. BaseCommand receives IOService as a dependency injection. The rules document incorrectly specifies the integration points—it should reference IOService, not separate output/input traits.

Ignore the original review comment. The actual implementation is sound; the rules documentation requires correction.

Likely an incorrect or invalid review comment.

.cursor/rules/01-architecture.mdc (1)

1-134: Architecture rules verified: Container implementation matches documentation.

The Container class at ./app/Container.php correctly implements both bind() (line 46) and build() (line 59) methods as documented. Method signatures match: bind(string $className, object $instance): self returns self for chaining, and build(string $className): object returns auto-wired instances or bound mocks. All PHP code examples (lines 20–68) are syntactically valid and accurately represent the documented patterns. The implementation uses reflection for dependency auto-wiring and includes circular dependency detection, matching the architectural specification.

Comment thread .cursor/rules/00-main.mdc Outdated
Comment on lines +50 to +54
### Tests

**✔️ Tests are off-limits:** Don't run or edit tests; run or edit tests ONLY if explicitly instructed to do so!
Don't run or create or update tests UNLESS explicitly instructed to do so.

**🧠 AI Agent Protocol:** ULTRATHINK → STEP BY STEP → ACT
Test are something we need focus on separately from building features.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor: Fix grammatical error in Tests section.

Line 54 should read "Tests are something we need to focus on separately" (missing "to").

🤖 Prompt for AI Agents
In .cursor/rules/00-main.mdc around lines 50 to 54, the sentence "Test are
something we need focus on separately from building features." is missing the
word "to"; update it to "Tests are something we need to focus on separately from
building features." and also correct "Test" to plural "Tests" if not already,
ensuring proper grammar and spacing.

echo "✓ Setup complete"
```

See: server-info.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify external reference to server-info.sh exists.

The reference "See: server-info.sh" at line 154 should point to an existing file. Confirm the file exists and is the correct location for cross-referencing from this playbook guidelines document.


🏁 Script executed:

#!/bin/bash
# Search for server-info.sh in the repository
fd -name 'server-info.sh' --type f

Length of output: 230



---

🏁 Script executed:

```shell
#!/bin/bash
# Corrected search for server-info.sh using proper fd syntax
fd 'server-info\.sh' --type f

# Also search for any .sh files to understand context
echo "=== Shell scripts in repository ==="
fd '\.sh$' --type f

Length of output: 35



---

🏁 Script executed:

```shell
#!/bin/bash
# Explore repository structure
echo "=== Repository root files/directories ==="
ls -la

echo ""
echo "=== Search for 'server-info' references ==="
rg -i 'server-info' --type md

echo ""
echo "=== All files in .cursor/rules/ ==="
find .cursor/rules -type f 2>/dev/null | head -20

Length of output: 1729



---

🏁 Script executed:

```shell
#!/bin/bash
# Examine the context around line 154 in 05-playbooks.mdc
echo "=== Content around line 154 of 05-playbooks.mdc ==="
sed -n '145,165p' .cursor/rules/05-playbooks.mdc

echo ""
echo "=== Full line 154 ==="
sed -n '154p' .cursor/rules/05-playbooks.mdc

Length of output: 257


Remove broken reference to non-existent server-info.sh file.

The reference "See: server-info.sh" at line 154 points to a file that does not exist in the repository. No shell scripts are present in this codebase (PHP/Node.js project). Either remove this reference or replace it with a valid, existing file path if cross-referencing is intended.

🤖 Prompt for AI Agents
In .cursor/rules/05-playbooks.mdc around line 154, remove or replace the broken
reference "See: server-info.sh" which points to a non-existent shell script;
update the line to either delete the reference entirely or point it to a valid
existing file or documentation in this repo (e.g., a PHP/Node.js README or
internal doc) and verify the new path is correct and linked consistently
elsewhere in the file.

@loadinglucian
loadinglucian merged commit 2eeb18c into main Oct 24, 2025
3 of 5 checks passed
@loadinglucian
loadinglucian deleted the docs/copilot-rules branch October 24, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant