Skip to content

Commit 77fccb1

Browse files
committed
Address for improvements skills
1 parent 7322cb4 commit 77fccb1

File tree

6 files changed

+188
-55
lines changed

6 files changed

+188
-55
lines changed

.agents/skills/add-to-fedify-init/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ modifications consistent with the existing code style and context.
3434
### Write the `WebFrameworkDescription` object
3535

3636
Create a `packages/init/src/webframeworks/framework.ts` file and write the
37-
`WebFrameworkDescription` object, referring to <init/framework.ts>. Check
38-
the specifications in the comments in `packages/init/src/types.ts` for
39-
details.
37+
`WebFrameworkDescription` object, referring to
38+
[init/framework.ts](./init/framework.ts). Check the specifications in the
39+
comments in `packages/init/src/types.ts` for details.
4040

4141
### Add to the `WEB_FRAMEWORK` array
4242

.agents/skills/create-example-app-with-integration/SKILL.md

Lines changed: 62 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Two reference documents describe what the example must do and how it must
2727
look. Both are references only — do not create these files in the actual
2828
generated example app.
2929

30-
### <ARCHITECTURE.md>
30+
### [ARCHITECTURE.md](./ARCHITECTURE.md)
3131

3232
Defines the example's functional behavior. Consult it for:
3333

@@ -44,10 +44,11 @@ Defines the example's functional behavior. Consult it for:
4444
bridge between the framework routing layer and the federation layer.
4545
- **Federation** and **Storing**: Which source files to set up
4646
(`src/federation.ts`, `src/store.ts`) and the template files they are
47-
based on (<example/src/federation.ts>, <example/src/store.ts>).
47+
based on ([example/src/federation.ts](./example/src/federation.ts),
48+
[example/src/store.ts](./example/src/store.ts)).
4849
- **Logging**: How to use `@logtape/logtape` and `src/logging.ts`.
4950

50-
### <DESIGN.md>
51+
### [DESIGN.md](./DESIGN.md)
5152

5253
Defines the example's visual presentation. Consult it for:
5354

@@ -61,7 +62,8 @@ Defines the example's visual presentation. Consult it for:
6162
- **Layout principles**: Spacing, containers, grid, and whitespace.
6263
- **Responsive behavior**: Single breakpoint at `768px` and mobile
6364
adaptations.
64-
- **Static assets**: Files to serve from `public/` (<example/public/\*>).
65+
- **Static assets**: Files to serve from `public/`
66+
([example/public/](./example/public/)).
6567
- **Page structure**: Detailed layout of the home page, actor profile
6668
page, and post detail page.
6769

@@ -70,46 +72,77 @@ Set up the example project
7072
--------------------------
7173

7274
Create an `examples/framework/` app and write an example for the new
73-
package. Unless the framework itself prevents it, support both Deno and
74-
Node.js environments. If Deno is supported, add a *deno.json* based on
75-
<example/deno.json>; if Node.js is supported, add *package.json* based on
76-
<example/package.jsonc> and *tsdown.config.ts*. Depending on the supported
77-
environments, add the example path to the `workspace` field in
78-
the root *deno.json* and to the `packages` field in
79-
*pnpm-workspace.yaml*.
75+
package. Copy the template files from [example/](./example/) as-is and modify
76+
as needed.
77+
78+
- [deno.json](./example/deno.jsonc)
79+
- Deno configuration for the example app.
80+
- If the framework does not support Deno, this file can be omitted.
81+
- [package.json](./example/package.jsonc)
82+
- Node.js configuration for the example app.
83+
- If the framework does not support Node.js, this file can be omitted.
84+
- [federation.ts](./example/src/federation.ts): Set up the Federation instance
85+
and configure ActivityPub handling.
86+
- [logging.ts](./example/src/logging.ts): Set up Logtape logging.
87+
- [store.ts](./example/src/store.ts): Set up in-memory stores for actors,
88+
posts, and followers.
89+
- [fedify-logo.svg](./example/public/fedify-logo.svg)
90+
- The Fedify logo.
91+
- Use this file as favicon.
92+
- You can make a custom logo to add the svg of the framework logo.
93+
- [demo-profile.png](./example/public/demo-profile.png):
94+
- Profile image for the demo user.
95+
- You can make this image from the `fedify-logo.svg` rendering to png
96+
- [style.css](./example/public/style.css): The CSS file for the example app.
97+
- [theme.js](./example/public/theme.js): The JavaScript file for theme
98+
toggling dark/light mode in the example app.
99+
100+
Unless the framework itself prevents it, support both Deno
101+
and Node.js environments. If Deno is supported, add a *deno.json* based on
102+
[example/deno.json](./example/deno.jsonc); if Node.js is supported, add
103+
*package.json* based on [example/package.jsonc](./example/package.jsonc) and
104+
*tsdown.config.ts*. Depending on the supported environments, add the example
105+
path to the `workspace` field in the root *deno.json* and to the `packages`
106+
field in *pnpm-workspace.yaml*.
80107

81108
If the framework is backend-only and needs a frontend framework, and there
82109
is no natural pairing like solidstart-solid, use Hono.
83110

84-
Copy the template files from <example/\*> as-is and modify as needed.
85-
86111
If the framework does not have a prescribed entry point, use `src/main.ts`
87112
as the application entry point. Define and export the framework app in
88113
`src/app.ts`, then import and run it from the entry file. Import
89114
`src/logging.ts` in the entry file to initialize `@logtape/logtape`.
90115
When logging is needed, use the `getLogger` function from `@logtape/logtape`
91116
to create a logger.
92117

118+
When configuring the example app server, disable host restrictions and allow
119+
all hosts so tunneled/public domains can access the app during development
120+
and tests.
121+
93122

94123
Implement the example app
95124
-------------------------
96125

97-
Follow the specifications in <ARCHITECTURE.md> and <DESIGN.md> to
98-
implement the example. In particular:
126+
Follow the specifications in [ARCHITECTURE.md](./ARCHITECTURE.md) and
127+
[DESIGN.md](./DESIGN.md) to implement the example. In particular:
99128

100129
- Register the Fedify middleware in `src/app.ts` per the “Middleware
101130
integration” and “Reverse proxy support” sections of
102-
<ARCHITECTURE.md>.
131+
[ARCHITECTURE.md](./ARCHITECTURE.md).
103132
- Set up federation logic in `src/federation.ts` based on
104-
<example/src/federation.ts>. Set up in-memory stores in `src/store.ts`
105-
based on <example/src/store.ts>.
133+
[example/src/federation.ts](./example/src/federation.ts). Set up in-memory
134+
stores in `src/store.ts` based on
135+
[example/src/store.ts](./example/src/store.ts).
106136
- Implement all routes listed in the “Routing” section of
107-
<ARCHITECTURE.md>, using `RequestContext` as described in the
108-
“Server-side data access” section.
109-
- Render HTML pages according to <DESIGN.md>. Serve static assets from
110-
the `public/` directory (copy from <example/public/\*>).
137+
[ARCHITECTURE.md](./ARCHITECTURE.md), using `RequestContext` as described
138+
in the “Server-side data access” section.
139+
- Render HTML pages according to [DESIGN.md](./DESIGN.md). Serve static assets
140+
from the `public/` directory (copy from
141+
[example/public/](./example/public/)).
111142
- Implement the SSE endpoint per the “Server-sent events” section of
112-
<ARCHITECTURE.md>.
143+
[ARCHITECTURE.md](./ARCHITECTURE.md).
144+
- Ensure the app can build and run in the supported environments
145+
(Deno, Node.js, or both).
113146

114147

115148
Test the example with `mise test:examples`
@@ -142,6 +175,11 @@ is broken:
142175
mise test:examples
143176
~~~~
144177

178+
If the `test:examples` can not be run, just run the server and test with curl:
179+
180+
~~~~ bash
181+
curl -H "Accept: application/activity+json" http://localhost:0000/users/demo
182+
145183

146184
Lint, format, and final checks
147185
------------------------------
@@ -152,3 +190,4 @@ root path.
152190
After implementation, run `mise run fmt && mise check`.
153191
If there are lint or format errors, fix them and run the command again until
154192
there are no errors.
193+
~~~~

.agents/skills/create-example-app-with-integration/example/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
<!-- Replace `프레임워크` with the name of the framework you are integrating with -->
44

5-
프레임워크 example application
6-
==============================
5+
Fedify-프레임워크 integration example application
6+
=================================================
77

88
A comprehensive example of building a federated server application using
99
[Fedify] with [프레임워크]. This example demonstrates how to create an
1010
ActivityPub-compatible federated social media server that can interact with
11-
other federated platforms like Mastodon, Pleroma, and other ActivityPub
11+
other federated platforms like [Mastodon], [Misskey], and other ActivityPub
1212
implementations using the Fedify and [프레임워크].
1313

1414
[Fedify]: https://fedify.dev
1515
[프레임워크]: https://프레임.워크/
16+
[Mastodon]: https://mastodon.social/
17+
[Misskey]: https://misskey.io/
1618

1719

1820
Running the example
@@ -40,14 +42,14 @@ Communicate with other federated servers
4042
1. Tunnel your local server to the internet using `fedify tunnel`
4143

4244
~~~~ sh
43-
fedify tunnel 0000
45+
fedify tunnel 0000
4446
~~~~
4547

4648
2. Open the tunneled URL in your browser and check that the server is running
4749
properly.
4850

49-
3. Search your handle and follow from other federated servers such as Mastodon
50-
or Misskey.
51+
3. Search your handle and follow from other federated servers such as
52+
[Mastodon] or [Misskey].
5153

5254
> [!NOTE]
5355
> [ActivityPub Academy] is a great resource to learn how to interact

.agents/skills/create-example-app-with-integration/example/src/logging.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { configure, getConsoleSink } from "@logtape/logtape";
1+
import {
2+
configure, // If top-level await is not supported, replace with configureSync
3+
getConsoleSink
4+
} from "@logtape/logtape";
25
import { AsyncLocalStorage } from "node:async_hooks";
36

47
await configure({

0 commit comments

Comments
 (0)