Skip to content

Commit 39c35c0

Browse files
committed
Updated readme.md + Switched to HTTPS Sync
1 parent d187a47 commit 39c35c0

5 files changed

Lines changed: 58 additions & 32 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Dependencies
22
vendor/*
33
vendor/
4+
guidelines/
5+
46
node_modules/
57

68
# Composer

README.md

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
# codebar Solutions AG Coding Guidelines
22

3-
Shared Laravel AI coding guidelines and skills for codebar-ag projects. A Boost-first Composer package that ships 36 skills for consistent conventions across PHP, Laravel, testing, frontend, and services.
3+
Shared Laravel coding guidelines and skills for codebar-ag projects. A Composer package that ships 36 skills for consistent conventions across PHP, Laravel, testing, frontend, and services.
44

55
**Rule index:** See [RULES.md](RULES.md) for the full rule structure and file reference.
66

77
---
88

9-
## CI
10-
11-
GitHub Actions run on push and pull requests:
12-
13-
- **CI workflow** — Composer validate, PHP syntax check, skill structure validation (frontmatter, count)
14-
- **Skill Integration** — AI-powered verification: one test prompt per skill (36 total), sends to GitHub Models, validates responses follow guidelines. Runs on prompt/skill changes, weekly schedule, and manual trigger. Requires `models: read` and GitHub Models access.
15-
16-
Run validation locally: `composer validate-skills`
17-
18-
---
9+
## Skills Overview
1910

20-
## Skills Summary
11+
Skills are reusable convention guides that assistants use when working with your codebase. Each skill includes Rules, Examples, Anti-Patterns, and References.
2112

2213
| Category | Skills | Description |
2314
|----------|--------|-------------|
@@ -27,7 +18,7 @@ Run validation locally: `composer validate-skills`
2718
| **Testing** | PHPUnit, PestTesting, PHPStan, Dusk | Unit/feature tests, static analysis, browser tests |
2819
| **Services** | Saloon, DocuWare, Albatros | External API integrations (Saloon, DocuWare, Albatros) |
2920

30-
**Total: 36 skills.** Each skill includes Rules, Examples, Anti-Patterns, and References.
21+
**Total: 36 skills.**
3122

3223
---
3324

@@ -49,18 +40,10 @@ php artisan boost:install
4940

5041
### Step 2: Add this package
5142

52-
**Option A — Composer (recommended for version pinning):**
53-
5443
```bash
5544
composer require codebar-ag/coding-guidelines --dev
5645
```
5746

58-
**Option B — GitHub via Boost:**
59-
60-
```bash
61-
php artisan boost:add-skill codebar-ag/coding-guidelines
62-
```
63-
6447
### Step 3: Sync skills
6548

6649
```bash
@@ -71,7 +54,7 @@ Boost automatically discovers skills from `vendor/codebar-ag/coding-guidelines/r
7154

7255
### Step 4: Activate MCP (optional)
7356

74-
If your editor supports MCP (Model Context Protocol), configure it to use the Boost MCP server for full context. See the [Laravel Boost documentation](https://laravel.com/docs/boost) for your editors setup.
57+
If your editor supports MCP (Model Context Protocol), configure it to use the Boost MCP server for full context. See the [Laravel Boost documentation](https://laravel.com/docs/boost) for your editor's setup.
7558

7659
### Step 5: Override skills locally (optional)
7760

@@ -87,6 +70,18 @@ your-project/
8770
│ └── SKILL.md ← Your custom version
8871
```
8972

73+
### Alternative: Sync full repo
74+
75+
To sync the complete guidelines repo (`.github/prompts`, `RULES.md`, etc.) into a `guidelines/` directory for reference, add to your `composer.json`:
76+
77+
```json
78+
"scripts": {
79+
"sync-guidelines": "php vendor/codebar-ag/coding-guidelines/scripts/sync-guidelines.php"
80+
}
81+
```
82+
83+
Then run `composer sync-guidelines`. This clones or pulls the repo into `guidelines/` at your project root.
84+
9085
---
9186

9287
## How It Works
@@ -102,15 +97,13 @@ This package places skills in `resources/boost/skills/{skill-name}/SKILL.md`. La
10297

10398
## Updating
10499

105-
When using Composer:
106-
107100
```bash
108101
composer update codebar-ag/coding-guidelines
109102
php artisan boost:update
110103
```
111104

112-
When using `boost:add-skill`:
105+
---
113106

114-
```bash
115-
php artisan boost:update
116-
```
107+
## CI
108+
109+
GitHub Actions run on push and pull requests. Run validation locally: `composer validate-skills`

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"name": "codebar-ag/coding-guidelines",
3-
"description": "Shared Laravel AI coding guidelines and skills for codebar-ag projects. Boost-first Composer package.",
3+
"description": "Shared Laravel coding guidelines and skills for codebar-ag projects. Composer package for Laravel Boost.",
44
"keywords": [
55
"laravel",
66
"boost",
7-
"ai",
87
"cursor",
98
"coding-guidelines",
109
"skills"
@@ -35,7 +34,8 @@
3534
}
3635
},
3736
"scripts": {
38-
"validate-skills": "php scripts/validate-skills.php"
37+
"validate-skills": "php scripts/validate-skills.php",
38+
"sync-guidelines": "php scripts/sync-guidelines.php"
3939
},
4040
"config": {
4141
"sort-packages": true

resources/boost/skills/saloon/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ description: Saloon-based service layer pattern for all external API integration
2121
- The service class wraps the connector, sends requests, and returns typed DTOs
2222
- Register the connector as a singleton in a service provider when needed
2323
- Accept an optional connector in the service constructor for testability
24-
- Exceptions: **Prism** is acceptable for AI/LLM integrations; inline `Http::get()` is acceptable for simple binary file downloads (not API integrations)
24+
- Exceptions: **Prism** is acceptable for LLM integrations; inline `Http::get()` is acceptable for simple binary file downloads (not API integrations)
2525

2626
## Examples
2727

scripts/sync-guidelines.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/**
4+
* Sync shared coding guidelines from the codebar-ag/coding-guidelines repo.
5+
*
6+
* Clones (first run) or pulls (subsequent runs) the repo directly into
7+
* the `guidelines/` directory at the project root.
8+
*
9+
* Fails gracefully if the repo is unreachable (e.g. network offline).
10+
*/
11+
$repo = 'https://github.com/codebar-ag/coding-guidelines.git';
12+
$targetDir = 'guidelines';
13+
14+
if (is_dir($targetDir.'/.git')) {
15+
exec("git -C {$targetDir} remote set-url origin {$repo} 2>&1", $remoteOutput, $remoteExit);
16+
exec("git -C {$targetDir} fetch origin main --quiet 2>&1", $fetchOutput, $fetchExit);
17+
if ($fetchExit === 0) {
18+
exec("git -C {$targetDir} reset --hard FETCH_HEAD 2>&1", $resetOutput, $exitCode);
19+
} else {
20+
$exitCode = $fetchExit;
21+
}
22+
} else {
23+
exec("git clone --depth 1 --quiet {$repo} {$targetDir} 2>&1", $output, $exitCode);
24+
}
25+
26+
if ($exitCode !== 0) {
27+
echo 'Warning: Could not sync guidelines (repo not accessible).'.PHP_EOL;
28+
exit(0); // Don't break composer install
29+
}
30+
31+
echo "Guidelines synced to {$targetDir}/.".PHP_EOL;

0 commit comments

Comments
 (0)