Skip to content

Commit ec3e496

Browse files
committed
Selfreview
1 parent e6910f4 commit ec3e496

4 files changed

Lines changed: 90 additions & 104 deletions

File tree

.agents/skills/external/ibexa-documentation/SKILL.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ It contains two documentation sets:
1616

1717
Use the documentation for what the code cannot tell you:
1818

19-
- Concepts and the content model: content types, fields, locations,
20-
versions, languages, and how they relate.
19+
- Concepts and the content model: content types, fields, locations, versions, languages, and how they relate.
2120
- Release notes and changes between versions: `developer/release_notes/`.
2221
- Update and migration instructions: `developer/update_and_migration/`.
2322
- Project and feature setup, configuration, and best practices: `developer/infrastructure_and_maintenance/`.

.github/workflows/release_composer_package.yaml

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,53 @@ on:
44
schedule:
55
# Daily at 03:17 UTC. Fans out to every maintained version branch (see determine-branches).
66
- cron: "17 3 * * *"
7-
workflow_dispatch: ~
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "Version branch to release"
11+
required: true
12+
default: "5.0"
13+
type: string
14+
devdoc_branch:
15+
description: "Developer documentation branch to check out (defaults to version)"
16+
required: false
17+
default: ""
18+
type: string
19+
userdoc_branch:
20+
description: "User documentation branch to check out (defaults to version)"
21+
required: false
22+
default: ""
23+
type: string
824

925
jobs:
1026
determine-branches:
1127
runs-on: ubuntu-latest
1228
outputs:
1329
branches: ${{ steps.set.outputs.branches }}
30+
devdoc_branch: ${{ steps.set.outputs.devdoc_branch }}
31+
userdoc_branch: ${{ steps.set.outputs.userdoc_branch }}
1432
steps:
1533
- id: set
1634
run: |
1735
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
18-
# Manual runs only release the branch the workflow was dispatched from.
19-
branches='["${{ github.ref_name }}"]'
36+
# Manual runs release the branch chosen via the "version" input,
37+
# not necessarily the branch the workflow was dispatched from.
38+
branches='["${{ github.event.inputs.version }}"]'
39+
# Left empty when not overridden; the release job then falls back
40+
# to the version branch (matrix.branch) for the checkout ref.
41+
devdoc_branch="${{ github.event.inputs.devdoc_branch }}"
42+
userdoc_branch="${{ github.event.inputs.userdoc_branch }}"
2043
else
2144
# Scheduled runs always execute in the default branch's context, so they must
2245
# explicitly check out each maintained version branch instead of relying on
2346
# GITHUB_REF. Extend this list as new branches become active / drop EOL ones.
2447
branches='["5.0"]'
48+
devdoc_branch=""
49+
userdoc_branch=""
2550
fi
2651
echo "branches=${branches}" >> "$GITHUB_OUTPUT"
52+
echo "devdoc_branch=${devdoc_branch}" >> "$GITHUB_OUTPUT"
53+
echo "userdoc_branch=${userdoc_branch}" >> "$GITHUB_OUTPUT"
2754
2855
release:
2956
needs: determine-branches
@@ -43,13 +70,13 @@ jobs:
4370
# pulling the full history + every daily tag snapshot (which took minutes).
4471
- uses: actions/checkout@v4
4572
with:
46-
ref: ${{ matrix.branch }}
73+
ref: ${{ needs.determine-branches.outputs.devdoc_branch || matrix.branch }}
4774

4875
- name: Check out user documentation
4976
uses: actions/checkout@v4
5077
with:
5178
repository: ibexa/documentation-user
52-
ref: ${{ matrix.branch }}
79+
ref: ${{ needs.determine-branches.outputs.userdoc_branch || matrix.branch }}
5380
path: user-docs
5481

5582
- name: Set up Python
@@ -72,13 +99,13 @@ jobs:
7299
php-version: "8.3"
73100
coverage: none
74101

75-
# - name: Generate token
76-
# id: generate_token
77-
# uses: actions/create-github-app-token@v2
78-
# with:
79-
# app-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
80-
# private-key: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
81-
# owner: ${{ github.repository_owner }}
102+
- name: Generate token
103+
id: generate_token
104+
uses: actions/create-github-app-token@v2
105+
with:
106+
app-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
107+
private-key: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
108+
owner: ${{ github.repository_owner }}
82109

83110
- name: Add composer keys for private packagist
84111
run: |
@@ -87,7 +114,7 @@ jobs:
87114
env:
88115
SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
89116
SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
90-
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} #${{ steps.generate_token.outputs.token }}
117+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
91118

92119
# Needed to resolve the PHP API classes referenced by the docs to
93120
# their vendor/ source paths (dump_class_paths.php).
@@ -117,6 +144,10 @@ jobs:
117144
- name: Copy package README
118145
run: cp tools/llm_package/README.package.md README.md
119146

147+
- name: Smoke-test package output
148+
run: |
149+
composer validate
150+
120151
- name: Find the last tag for this branch
121152
id: last_tag
122153
env:

build_package_docs.py

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
11
"""
22
Build the Composer-package Markdown docs from the MkDocs build outputs.
33
4-
The package bundles two documentation sets, each produced by its own MkDocs
5-
build with the llmstxt plugin:
6-
7-
- ``developer/`` — ibexa/documentation-developer (this repository, built into
8-
``site/``)
9-
- ``user/`` — ibexa/documentation-user (checked out and built next to it, into
10-
``user-docs/site/``)
11-
12-
Each set gets its own ``llms.txt`` table of contents at its root. The website
13-
outputs keep absolute https://doc.ibexa.co URLs; the Composer package must work
14-
offline inside vendor/ibexa/documentation-developer, so links are rewritten:
15-
16-
- Page links (``https://doc.ibexa.co/en/latest/<path>/[#anchor]`` for the
17-
developer docs, ``https://doc.ibexa.co/projects/userguide/en/latest/…`` for
18-
the user docs) become relative links to the corresponding
19-
``<set>/<path>/index.md`` file — including cross-set links between the two
20-
documentations. URLs matching a mkdocs-redirects entry are resolved through
21-
the redirect first. URLs with no local page (other doc.ibexa.co projects,
22-
images, the separately hosted API reference HTML) are left untouched.
23-
- PHP API class links (``…/php_api_reference/classes/<Slug>.html``) become
24-
relative links to the class source file in the *installed project's*
25-
vendor/ directory, using the FQCN→path map produced by
26-
``tools/llm_package/dump_class_paths.php``. The link text is upgraded to the
27-
backticked FQCN (when it was just the short class name) so the class stays
28-
greppable even if the target package isn't installed in the user's project.
29-
Unmapped classes keep their absolute URL.
30-
31-
Run after both ``mkdocs build``s:
32-
33-
php tools/llm_package/dump_class_paths.php site user-docs/site class_paths.json
34-
python build_package_docs.py --version 5.0
35-
36-
Like llmstxt_preprocess.py, all transformations are pure functions so they can
37-
be unit-tested (tests/python/test_build_package_docs.py).
4+
The package bundles two documentation sets, each produced by its own MkDocs build with the llmstxt plugin:
5+
6+
- `developer/` — ibexa/documentation-developer
7+
- `user/` — ibexa/documentation-user
8+
9+
Each set gets its own `llms.txt` table of contents at its root.
10+
11+
The following transformations are applied to the MkDocs build outputs before writing them into the package::
12+
13+
- Page links to developer and user documentation become relative links to the corresponding `<set>/<path>/index.md`` files, including cross-set links between the two documentations:
14+
15+
URLs matching a mkdocs-redirects entry are resolved through the redirect first.
16+
URLs with no local page (other doc.ibexa.co projects, images, the separately hosted API reference HTML) are left untouched.
17+
Links to versions other than the current branch's version (e.g. en/4.0/…) are also left untouched.
18+
19+
- PHP API class links (`.../php_api_reference/classes/<Slug>.html`) become relative links to the class source file in the vendor/ director:
20+
21+
By using the FQCN -> path map produced by `tools/llm_package/dump_class_paths.php`.
22+
The link text is upgraded to the FQCN so the class stays greppable even if the target package isn't installed in the user's project.
23+
24+
Run after both documentation sites are built with MkDocs:
25+
26+
``` bash
27+
php tools/llm_package/dump_class_paths.php site user-docs/site class_paths.json
28+
python build_package_docs.py --version 5.0
29+
```
3830
"""
3931

4032
import argparse
@@ -341,7 +333,7 @@ def main():
341333
parser.add_argument("--user-plugins", default="user-docs/plugins.yml",
342334
help="User docs plugins.yml with redirect_maps")
343335
parser.add_argument("--class-map", default="class_paths.json",
344-
help="FQCNvendor path map from dump_class_paths.php")
336+
help="FQCN -> vendor path map from dump_class_paths.php")
345337
parser.add_argument("--version", default=None,
346338
help="This branch's documentation version (e.g. 5.0): links pinned to "
347339
"it (en/5.0/…) are rewritten like en/latest ones")
Lines changed: 18 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,31 @@
11
# Ibexa DXP documentation
22

3-
This package contains the official Ibexa DXP documentation as plain Markdown
4-
files, generated from the same sources as the website. Install it into an Ibexa
5-
DXP project so that AI coding assistants (and humans) can read the
6-
documentation offline, right next to the code it describes:
3+
Official Ibexa DXP documentation as plain Markdown files.
74

8-
```bash
9-
composer require --dev ibexa/documentation-developer:~5.0
10-
```
5+
## Installation
116

12-
## Layout
7+
Run the following command:
138

14-
- `developer/` — the [developer documentation](https://doc.ibexa.co/en/latest/):
15-
APIs, extension points, configuration, tutorials.
16-
- `user/` — the [user documentation](https://doc.ibexa.co/projects/userguide/en/latest/):
17-
working with the back office, content management, commerce.
18-
- Each set has its own `llms.txt` at its root (`developer/llms.txt`,
19-
`user/llms.txt`) — a table of contents with relative links. Start there to
20-
find the right page.
21-
- One Markdown file per page, mirroring the URL structure of the website:
22-
`developer/<section>/.../<page>/index.md` corresponds to
23-
`https://doc.ibexa.co/en/latest/<section>/.../<page>/`, and
24-
`user/<section>/.../<page>/index.md` to
25-
`https://doc.ibexa.co/projects/userguide/en/latest/<section>/.../<page>/`.
26-
- `.agents/skills/external/` — agent skills for working with Ibexa DXP. When
27-
the package is installed with Symfony Flex, its recipe copies them into your
28-
project's `.agents/skills/ibexa/` directory.
9+
```bash
10+
composer require --dev ibexa/documentation-developer:~5.0 --no-scripts
11+
```
2912

30-
## Conventions
13+
## Content
3114

32-
- Links between documentation pages are relative Markdown links and work
33-
offline — including cross-links between the developer and user documentation.
34-
- PHP API references are links to the class source in your project's `vendor/`
35-
directory, with the fully qualified class name as the link text, for example
36-
``[`Ibexa\Contracts\Core\Repository\SearchService`](../../../../core/src/contracts/Repository/SearchService.php)``.
37-
If your project doesn't include the package a class belongs to, the link
38-
target won't exist — the class name in the link text still tells you what the
39-
reference is.
40-
- A few links have no local equivalent and stay absolute: images, the
41-
[PHP API reference](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/)
42-
itself, and other documentation sites (e.g. Ibexa Connect).
15+
This package contains two documentation sets:
4316

44-
## Using with AI agents
17+
- `developer` contains content of the [developer documentation](https://doc.ibexa.co/en/latest/).
18+
- `user` contains content of the [user documentation](https://doc.ibexa.co/en/latest/).
4519

46-
Point your agent at this package, for example by adding to your project's
47-
`CLAUDE.md` / `AGENTS.md`:
20+
Each set has its own `llms.txt` at its root (`developer/llms.txt`, `user/llms.txt`) with a table of contents with relative links.
4821

49-
```markdown
50-
Ibexa DXP documentation is installed locally in
51-
vendor/ibexa/documentation-developer/: developer documentation in developer/,
52-
user documentation in user/. To find a topic, read the set's table of contents
53-
(developer/llms.txt or user/llms.txt) or search the Markdown files, then follow
54-
the relative links. PHP API links in the docs point at the class sources in
55-
vendor/.
56-
```
22+
## Use with AI Agents
5723

58-
## Versioning
24+
To use the documentation with AI agents, you can:
5925

60-
A new tag is published whenever the generated documentation content changes;
61-
tag names combine the documentation branch and the build date. Use a `~5.0`
62-
constraint to stay on the documentation matching your Ibexa DXP version.
26+
- use the `ibexa-documentation` Agent skill provided by this package (recommended)
27+
- instruct the agent manually, by mentioning in the prompt:
6328

64-
The documentation sources live on the version branches of
65-
[ibexa/documentation-developer](https://github.com/ibexa/documentation-developer)
66-
and [ibexa/documentation-user](https://github.com/ibexa/documentation-user)
67-
— contributions are welcome there.
29+
``` text
30+
Ibexa DXP documentation is installed locally in vendor/ibexa/documentation-developer/
31+
```

0 commit comments

Comments
 (0)