Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ jobs:
# Configure Discourse settings (only if Discourse web app is up)
docker exec restarters php artisan discourse:setting personal_message_enabled_groups 10 || echo "Warning: discourse:setting failed - Discourse may not be fully started"

# Fail fast if a controller method lacks a #[UserStory]/#[NoStory] annotation or the specs manifest is stale
- run:
name: Check living specs
command: docker exec restarters php artisan specs:extract --check

# Run PHPUnit tests
- run:
name: Run PHPUnit tests
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/specs-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy Specs Site

on:
push:
branches: [develop]
paths:
- 'docs/specs/**'
- 'specs-site/**'

workflow_dispatch:

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
working-directory: specs-site
run: npm ci

Check warning on line 30 in .github/workflows/specs-site.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--ignore-scripts" allows lifecycle scripts to run during package installation.

See more on https://sonarcloud.io/project/issues?id=TheRestartProject_restarters.net&issues=AaD4YR6cWTJDW8uq5pH5&open=AaD4YR6cWTJDW8uq5pH5&pullRequest=835

- name: Build site
working-directory: specs-site
run: npm run build

- uses: actions/upload-pages-artifact@v3
with:
path: specs-site/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
14 changes: 14 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,20 @@ npm test
- Event-driven architecture with model observers
- Only translate fr and fr-BE

## Living Specifications

When modifying PHP controller or service methods:
- Maintain `#[UserStory]` and `#[Feature]` attributes (in `app/Attributes/`)
- Add `#[UserStory]` to new public methods that represent user-facing functionality
- Add `#[NoStory]` to methods that intentionally have no user story
- Update the story text if you change what a method does
- When adding or modifying tests, include `@story:ClassName::method` references
- Run `php artisan specs:extract` after annotation changes and commit the updated manifest
- Every public controller method needs `#[UserStory]` or `#[NoStory]`; `php artisan specs:extract --check` (run in CI) fails otherwise, and when the manifest is stale
- `@story:` refs in tests may use `ShortClass::method` only when that method name is unique across controllers; otherwise use the fully-qualified class (`App\Http\Controllers\API\GroupController::method`)
- Update the narrative in `docs/specs/narratives/` if feature coverage has changed
- Preserve human-written prose in narratives -- update structure and counts, not wording

## Development Warnings
- Don't try to test changes when you're running on Windows.

Expand Down
14 changes: 14 additions & 0 deletions app/Attributes/Feature.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_CLASS)]
class Feature
{
public function __construct(
public string $name,
public string $description = '',
) {}
}
13 changes: 13 additions & 0 deletions app/Attributes/NoStory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_METHOD)]
class NoStory
{
public function __construct(
public string $reason = '',
) {}
}
16 changes: 16 additions & 0 deletions app/Attributes/UserStory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class UserStory
{
public function __construct(
public string $story,
public string $persona,
public string $feature = '',
public string $theme = '',
) {}
}
Loading