Skip to content
Merged
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
43 changes: 43 additions & 0 deletions .ai/guidelines/01-domain.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Domain Docs

How the engineering skills should consume this repo's domain documentation when exploring the codebase.

## Before exploring, read these

- **`CONTEXT-MAP.md`** at the repo root — it points at one `CONTEXT.md` per module. Read each one relevant to the topic.
- **`docs/adr/`** — read ADRs that touch the area you're about to work in. Also check `app-modules/<module>/docs/adr/` for module-scoped decisions.

If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The producer skill (`/grill-with-docs`) creates them lazily when terms or decisions actually get resolved.

## File structure

This is a multi-context repo (modular monorepo via `internachi/modular`):

```
/
├── CONTEXT-MAP.md <- system-wide context map
├── docs/adr/ <- system-wide decisions
└── app-modules/
├── moderation/
│ ├── CONTEXT.md
│ └── docs/adr/ <- module-specific decisions
├── bot-discord/
│ ├── CONTEXT.md
│ └── docs/adr/
├── identity/
│ ├── CONTEXT.md
│ └── docs/adr/
└── ...
```

## Use the glossary's vocabulary

When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.

If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/grill-with-docs`).

## Flag ADR conflicts

If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:

> _Contradicts ADR-0007 — but worth reopening because..._
22 changes: 22 additions & 0 deletions .ai/guidelines/02-issue-tracker.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Issue tracker: GitHub

Issues and PRDs for this repo live as GitHub issues on `he4rt/he4rt-bot-api`. Use the `gh` CLI for all operations.

## Conventions

- **Create an issue**: `gh issue create --title "..." --body "..."`. Use a heredoc for multi-line bodies.
- **Read an issue**: `gh issue view <number> --comments`, filtering comments by `jq` and also fetching labels.
- **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with appropriate `--label` and `--state` filters.
- **Comment on an issue**: `gh issue comment <number> --body "..."`
- **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
- **Close**: `gh issue close <number> --comment "..."`

Infer the repo from `git remote -v` — `gh` does this automatically when run inside a clone.

## When a skill says "publish to the issue tracker"

Create a GitHub issue.

## When a skill says "fetch the relevant ticket"

Run `gh issue view <number> --comments`.
13 changes: 13 additions & 0 deletions .ai/guidelines/03-triage-labels.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Triage Labels

The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.

| Label in skills | Label in our tracker | Meaning |
| -------------------------- | -------------------- | ---------------------------------------- |
| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
| `needs-info` | `needs-info` | Waiting on reporter for more information |
| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
| `ready-for-human` | `ready-for-human` | Requires human implementation |
| `wontfix` | `wontfix` | Will not be actioned |

When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
91 changes: 91 additions & 0 deletions .ai/guidelines/99-knowledge-base.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Knowledge Base Documentation

This project uses `guava/filament-knowledge-base` for embedded docs inside the Filament admin panel. Docs are Markdown files rendered in the sidebar.

## Structure

All files live in `docs/admin/{lang}/`:

```
docs/admin/{lang}/
├── introduction.md
├── getting-started.md (type: group)
│ └── getting-started/
│ ├── navigating-the-panel.md
│ ├── dashboard.md
│ └── profile.md
├── users.md (type: group)
│ └── users/
│ ├── managing-users.md
│ ├── roles.md
│ ├── teams.md
│ └── authentication.md
└── system.md (type: group)
└── system/
├── activity-logs.md
├── emails.md
└── configuration.md
```

### Rules

- Maximum **3 levels** of nesting.
- Group directories require a matching `.md` file at the same level with `type: group` in front matter.
- All files require YAML front matter: `title`, `icon`, `order`.
- Use `heroicon-o-*` icons (Heroicons outlined set).

### Front Matter

```yaml
---
title: Page Title
icon: heroicon-o-document
order: 1
---
```

For groups, add `type: group`:

```yaml
---
title: Group Name
icon: heroicon-o-folder
order: 2
type: group
---
```

## Keeping Docs in Sync

When changes affect user-facing behavior, update `docs/admin/en/`:

- **New resource/page** — add a doc file under the appropriate group.
- **Changed nav groups/labels** — update the group `.md` and children.
- **Added/removed/renamed form fields** — update the resource's doc page.
- **Auth/authorization changes** — update `users/authentication.md` and `users/roles.md`.
- **System features** (logs, emails, config) — update under `system/`.

## Key Files

- `app/Filament/Plugins/BetterKnowledgeBase.php` — sidebar navigation builder
- `config/filament-knowledge-base.php` — plugin config (cache TTL, icons, model)
- `resources/views/vendor/filament-knowledge-base/livewire/help-menu.blade.php` — contextual help popover
- `lang/{en,pt_BR}/knowledge_base.php` — KB UI translations

## Contextual Help (HasKnowledgeBase)

Resources can implement `HasKnowledgeBase` for per-resource sidebar help:

```php
use Guava\FilamentKnowledgeBase\Contracts\HasKnowledgeBase;

class UserResource extends Resource implements HasKnowledgeBase
{
public static function getDocumentation(): array
{
return ['users.managing-users', 'users.roles'];
}
}
```

Doc IDs follow `{group}.{file-slug}` matching paths under `docs/admin/en/`.
34 changes: 0 additions & 34 deletions .ai/guidelines/filament.blade.php

This file was deleted.

31 changes: 0 additions & 31 deletions .ai/guidelines/knowledge-base.blade.php

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/.fleet
/.idea
/.kiro
/.agents
/.laracord
/.nova
/.phpunit.cache
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ public/
package-lock.json
composer.lock
storage/
.ai
41 changes: 41 additions & 0 deletions CONTEXT-MAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Context Map

This is a modular monorepo (`internachi/modular`). Each bounded context lives under `app-modules/` with its own `CONTEXT.md` and optional `docs/adr/`.

## Contexts

| Context | Path | Description |
| ------------------- | ---------------------------------- | --------------------------------------------------------------------------- |
| Moderation | `app-modules/moderation/` | Content moderation pipeline — classification, routing, enforcement, appeals |
| Bot Discord | `app-modules/bot-discord/` | Discord bot runtime (Laracord websocket, slash commands, event handlers) |
| Integration Discord | `app-modules/integration-discord/` | Discord platform transport (REST API via Saloon), OAuth, ETL |
| Identity | `app-modules/identity/` | Users, tenants, external identities, authentication |

## Relationships

```
┌─────────────────┐ ┌──────────────────────┐
│ Bot Discord │ │ Integration Discord │
│ (runtime/ws) │────────▶│ (transport/rest) │
└────────┬────────┘ └──────────┬───────────┘
│ │
│ listens to events │ provides DiscordConnector
▼ │
┌─────────────────┐ │
│ Moderation │◀───────────────────┘
│ (domain core) │
└────────┬────────┘
│ resolves identities
┌─────────────────┐
│ Identity │
│ (users/tenants) │
└─────────────────┘
```

### Dependency rules

- **Moderation** is platform-agnostic. It never imports from `bot-discord` or `integration-discord`.
- **Bot Discord** depends on Moderation (listens to domain events) and Integration Discord (uses transport).
- **Integration Discord** depends on Identity (OAuth user resolution). It never imports from Moderation.
- **Identity** has no upstream dependencies on other contexts listed here.
17 changes: 0 additions & 17 deletions PR.md

This file was deleted.

Loading