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
2 changes: 1 addition & 1 deletion harper-best-practices/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description:
automatic APIs, authentication, custom resources, and data handling.
Triggers on tasks involving Harper database design, API implementation,
and deployment.
license: MIT
license: Apache-2.0
metadata:
author: harper
version: '1.0.0'
Expand Down
6 changes: 2 additions & 4 deletions harper-best-practices/rules/checking-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ This project includes two Resource patterns for that flow:
- with an existing Authorization token (either Basic Auth or a JWT) and you want to issue new tokens, or
- from an explicit `{ username, password }` payload (useful for direct “login” from a CLI/mobile client).

```
js
```js
export class IssueTokens extends Resource {
static loadAsInstance = false;

Expand Down Expand Up @@ -119,8 +118,7 @@ static loadAsInstance = false;

**Description / use case:** When the JWT expires, the client uses the refresh token to get a new JWT without re-supplying username/password.

```
js
```js
export class RefreshJWT extends Resource {
static loadAsInstance = false;

Expand Down
8 changes: 5 additions & 3 deletions harper-best-practices/rules/vector-indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Use this skill when you need to perform similarity searches on high-dimensional
```
5. **Generate Embeddings**: Use external services (OpenAI, Ollama) to generate the numeric vectors before storing or searching them in Harper.

```typescript
const { Product } = tables;

import OpenAI from 'openai';
Expand Down Expand Up @@ -120,16 +121,17 @@ generateEmbedding = process.env.EMBEDDING_GENERATOR === 'ollama'

}

````
```

Sample request to the `ProductSearch` resource which prompts to find "shorts for the gym":

```bash
curl -X POST "http://localhost:9926/ProductSearch/" \
-H "accept: \
-H "accept: application/json \
-H "Content-Type: application/json" \
-H "Authorization: Basic <YOUR_AUTH>" \
-d '{"prompt": "shorts for the gym"}'
````
```

---

Expand Down