aas-setup 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +73 -0
- package/bin/aas-setup.mjs +34 -0
- package/configs/opencode/agent/ai-slop-remover.md +55 -0
- package/configs/opencode/agent/docs-writer.md +15 -0
- package/configs/opencode/agent/review.md +18 -0
- package/configs/opencode/agent/security-audit.md +17 -0
- package/configs/opencode/command/batch.md +58 -0
- package/configs/opencode/command/plannotator-annotate.md +6 -0
- package/configs/opencode/command/plannotator-last.md +3 -0
- package/configs/opencode/command/plannotator-review.md +6 -0
- package/configs/opencode/command/simplify.md +47 -0
- package/configs/opencode/opencode.json +137 -0
- package/configs/pi/AGENTS.md +49 -0
- package/configs/pi/mcp.json +24 -0
- package/configs/pi/models.json +0 -0
- package/configs/pi/settings.json +37 -0
- package/configs/pi/themes/dracula.json +87 -0
- package/configs/pi/themes/kanagawa.json +88 -0
- package/configs/reference/MEMORY.md +239 -0
- package/configs/reference/agent-memory.md +5 -0
- package/configs/reference/best-practices.md +270 -0
- package/configs/reference/git-guidelines.md +62 -0
- package/package.json +37 -0
- package/src/agents/opencode.mjs +22 -0
- package/src/agents/pi.mjs +22 -0
- package/src/agents/types.mjs +30 -0
- package/src/commands/init.mjs +99 -0
- package/src/commands/select.mjs +52 -0
- package/src/lib/exec.mjs +35 -0
- package/src/lib/fs.mjs +107 -0
- package/src/lib/log.mjs +39 -0
- package/src/lib/paths.mjs +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dung Huynh Duc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# aas-setup
|
|
2
|
+
|
|
3
|
+
Initialize **Pi** and **OpenCode** agent environments from a curated snapshot.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx aas-setup
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
One command installs both agent binaries (if missing) and deploys the curated config files into each agent's home directory, plus a copy of the cross-agent reference docs into each agent's own `aas-setup/` subdirectory so every agent is self-contained.
|
|
10
|
+
|
|
11
|
+
## What it does
|
|
12
|
+
|
|
13
|
+
Running `npx aas-setup`:
|
|
14
|
+
|
|
15
|
+
1. **Selects agents** — by default (TTY) an interactive multi-select with both Pi and OpenCode pre-checked; `aas-setup pi` / `aas-setup opencode` skip the prompt and configure only the named agent; non-TTY (CI) configures all.
|
|
16
|
+
2. **Installs binaries** — `pi` via `npm i -g @mariozechner/pi-coding-agent`, `opencode` via `curl -fsSL https://opencode.ai/install | bash`. Skips either if already on PATH.
|
|
17
|
+
3. **Deploys agent configs** — overwrites `~/.pi/agent/` (settings, mcp, models, AGENTS, themes) and `~/.config/opencode/` (opencode.json, agent/, command/) from the bundled `configs/`.
|
|
18
|
+
4. **Deploys reference docs** — copies `best-practices.md`, `git-guidelines.md`, `agent-memory.md`, `MEMORY.md` into `~/.pi/agent/aas-setup/` and `~/.config/opencode/aas-setup/`.
|
|
19
|
+
|
|
20
|
+
There is no backup prompt and no plugin enablement. It is non-interactive in CI.
|
|
21
|
+
|
|
22
|
+
## Flags
|
|
23
|
+
|
|
24
|
+
| Flag | Description |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| `[agents...]` | Positional: agent ids to configure (`pi`, `opencode`). Omit for interactive (TTY) or all (non-TTY). |
|
|
27
|
+
| `--dry-run` | Print every planned action (install / mkdir / copy / rm / backup) with full paths. Execute nothing. |
|
|
28
|
+
| `--backup` | Back up the existing agent homes to `~/ai-tools-backup-<timestamp>/` before overwriting. Default: no backup. |
|
|
29
|
+
| `--help` | Show usage. |
|
|
30
|
+
| `--version` | Show version. |
|
|
31
|
+
|
|
32
|
+
## Snapshot philosophy
|
|
33
|
+
|
|
34
|
+
This is a **snapshot**, not a generic installer. The configs ship exactly as the author uses them — including personal proxies, internal-IP providers, extension lists, and the personal `MEMORY.md`. No templating, no per-user substitution. Running `npx aas-setup` reproduces the author's environment on any machine with Node 18+.
|
|
35
|
+
|
|
36
|
+
## Scope
|
|
37
|
+
|
|
38
|
+
Only **Pi** and **OpenCode** are supported. The previous bash CLI configured 14+ agents; this rewrite intentionally dropped the other 12.
|
|
39
|
+
|
|
40
|
+
MCP server binaries (`qmd`, `sem-mcp`, `context7`, `agentmemory`, `sequential-thinking`) are **not** installed — only the MCP declaration files (`mcp.json`, `opencode.json`) are deployed. Each agent reports missing servers itself.
|
|
41
|
+
|
|
42
|
+
## Reference docs
|
|
43
|
+
|
|
44
|
+
`configs/reference/` is the single source of truth in the repo for the four cross-agent docs. At deploy time each agent gets its own physical copy in `<agent-home>/aas-setup/`, so editing a doc once in the repo updates every agent on the next `npx aas-setup` run. There is no shared `~/.ai-tools/` directory.
|
|
45
|
+
|
|
46
|
+
## Development
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
node bin/aas-setup.mjs --dry-run # preview
|
|
50
|
+
node bin/aas-setup.mjs # real run
|
|
51
|
+
npm test # node --test (process-seam tests)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Tests spawn the CLI with a temporary `HOME` and stubbed binaries on `PATH` so nothing touches the real user environment and no real `npm i -g` / `curl` runs.
|
|
55
|
+
|
|
56
|
+
## Releasing
|
|
57
|
+
|
|
58
|
+
Releases are published to npm by a GitHub Action when a version tag is pushed.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# 1. bump version in package.json (use a changeset or edit manually)
|
|
62
|
+
# 2. commit and tag
|
|
63
|
+
|
|
64
|
+
git tag v1.0.0
|
|
65
|
+
git push origin v1.0.0
|
|
66
|
+
# → .github/workflows/release.yml runs tests then `npm publish --provenance`
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The release workflow verifies the tag (`vX.Y.Z`) matches `package.json`'s `version` before publishing. Requires an `NPM_TOKEN` secret with publish rights on the `aas-setup` package. CI tests (`.github/workflows/test.yml`) run on every push/PR to `main`.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// aas-setup — initialize Pi and OpenCode agent environments from a snapshot.
|
|
4
|
+
//
|
|
5
|
+
// Usage:
|
|
6
|
+
// aas-setup TTY: interactive multi-select; non-TTY: all
|
|
7
|
+
// aas-setup pi only Pi
|
|
8
|
+
// aas-setup opencode only OpenCode
|
|
9
|
+
// aas-setup pi opencode explicit subset
|
|
10
|
+
// Flags: --dry-run, --backup, --help, --version.
|
|
11
|
+
|
|
12
|
+
import { program } from "commander";
|
|
13
|
+
import { AGENTS, initialize } from "../src/commands/init.mjs";
|
|
14
|
+
import { selectAgents } from "../src/commands/select.mjs";
|
|
15
|
+
|
|
16
|
+
program
|
|
17
|
+
.name("aas-setup")
|
|
18
|
+
.description("Initialize Pi and OpenCode agent environments from a curated snapshot")
|
|
19
|
+
.version("1.0.0")
|
|
20
|
+
.argument("[agents...]", "agent ids to configure (pi, opencode); omit for interactive/all")
|
|
21
|
+
.option("--dry-run", "print planned actions, execute nothing")
|
|
22
|
+
.option("--backup", "back up existing agent homes before overwriting")
|
|
23
|
+
.action(async (positional, opts) => {
|
|
24
|
+
const ids = await selectAgents(positional, { tty: process.stdin.isTTY });
|
|
25
|
+
const chosen = AGENTS.filter((a) => ids.includes(a.id));
|
|
26
|
+
const code = await initialize({
|
|
27
|
+
dryRun: !!opts.dryRun,
|
|
28
|
+
backup: !!opts.backup,
|
|
29
|
+
agents: chosen,
|
|
30
|
+
});
|
|
31
|
+
process.exit(code);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
program.parse();
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use this agent when you need to clean up AI-generated code that doesn't match the codebase's style and conventions. This includes removing unnecessary comments, excessive defensive checks, type casts to `any`, and other patterns that are inconsistent with how a human developer would write code in that file.
|
|
3
|
+
mode: subagent
|
|
4
|
+
temperature: 0.1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are an expert code quality engineer specializing in identifying and removing AI-generated code patterns that don't match human coding conventions. Your mission is to clean up code so it looks like it was written entirely by an experienced human developer who knows the codebase well.
|
|
8
|
+
|
|
9
|
+
## Your Process
|
|
10
|
+
|
|
11
|
+
1. **Get the diff against main**: Run `git diff main` to see all changes introduced in the current branch.
|
|
12
|
+
|
|
13
|
+
2. **Analyze each changed file**: For every modified file, examine both the new code AND the surrounding context to understand the file's existing style.
|
|
14
|
+
|
|
15
|
+
3. **Identify AI slop patterns**:
|
|
16
|
+
- **Unnecessary comments**: Comments explaining obvious code, redundant JSDoc on simple functions, or comments that don't match the commenting style elsewhere in the file
|
|
17
|
+
- **Excessive defensive checks**: Null checks, undefined checks, try/catch blocks, or validation that isn't present in similar code paths in the same file or that protect against already-validated inputs
|
|
18
|
+
- **Type escape hatches**: Casts to `any`, `as unknown as T` patterns, or `// @ts-ignore` comments added to work around type issues rather than fixing them properly
|
|
19
|
+
- **Over-engineering**: Extra abstractions, helper functions, or constants that add complexity without value
|
|
20
|
+
- **Inconsistent style**: Different naming conventions, bracket placement, or patterns than the rest of the file uses
|
|
21
|
+
- **Verbose error handling**: Elaborate error messages or logging that's more detailed than other error handling in the codebase
|
|
22
|
+
|
|
23
|
+
4. **Apply fixes surgically**: Remove or simplify the identified patterns while preserving the actual functionality. When removing defensive checks, ensure the code path is genuinely safe.
|
|
24
|
+
|
|
25
|
+
5. **Verify changes**: After making changes, run the appropriate checks:
|
|
26
|
+
- `yarn type-check` for TypeScript files
|
|
27
|
+
- `yarn lint` for style verification
|
|
28
|
+
- `yarn build-lib` if utility packages were touched
|
|
29
|
+
|
|
30
|
+
## Decision Framework
|
|
31
|
+
|
|
32
|
+
Before removing something, ask:
|
|
33
|
+
|
|
34
|
+
- Does similar code elsewhere in this file have this pattern? If not, remove it.
|
|
35
|
+
- Would a senior developer familiar with this codebase add this? If not, remove it.
|
|
36
|
+
- Does this comment explain something non-obvious? If not, remove it.
|
|
37
|
+
- Is this try/catch protecting against a realistic error case that similar code handles? If not, remove it.
|
|
38
|
+
- Is this type cast hiding a real type issue that should be fixed properly? If so, fix it instead.
|
|
39
|
+
|
|
40
|
+
## What NOT to Remove
|
|
41
|
+
|
|
42
|
+
- Comments that explain complex business logic or non-obvious decisions
|
|
43
|
+
- Error handling that matches patterns used elsewhere in the codebase
|
|
44
|
+
- Type assertions that are genuinely necessary and match existing patterns
|
|
45
|
+
- Validation at public API boundaries
|
|
46
|
+
|
|
47
|
+
## Output Format
|
|
48
|
+
|
|
49
|
+
After completing your review and fixes, provide ONLY a 1-3 sentence summary of what you changed. Do not list every individual change. Focus on the categories of changes made and the overall impact.
|
|
50
|
+
|
|
51
|
+
Example summaries:
|
|
52
|
+
|
|
53
|
+
- "Removed 12 redundant comments and 3 unnecessary try/catch blocks from the auth service. Simplified type assertions in user-utils.ts."
|
|
54
|
+
- "Cleaned up defensive null checks in the API handlers that duplicated validation already done by the middleware. No functional changes."
|
|
55
|
+
- "Removed verbose JSDoc comments and consolidated error handling to match the existing patterns in the order-processor module."
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Writes and maintains project documentation
|
|
3
|
+
mode: subagent
|
|
4
|
+
tools:
|
|
5
|
+
bash: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a technical writer. Create clear, comprehensive documentation.
|
|
9
|
+
|
|
10
|
+
Focus on:
|
|
11
|
+
|
|
12
|
+
- Clear explanations
|
|
13
|
+
- Proper structure
|
|
14
|
+
- Code examples
|
|
15
|
+
- User-friendly language
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Reviews code for quality and best practices
|
|
3
|
+
mode: subagent
|
|
4
|
+
temperature: 0.1
|
|
5
|
+
tools:
|
|
6
|
+
write: false
|
|
7
|
+
edit: false
|
|
8
|
+
bash: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You are in code review mode. Focus on:
|
|
12
|
+
|
|
13
|
+
- Code quality and best practices
|
|
14
|
+
- Potential bugs and edge cases
|
|
15
|
+
- Performance implications
|
|
16
|
+
- Security considerations
|
|
17
|
+
|
|
18
|
+
Provide constructive feedback without making direct changes.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Performs security audits and identifies vulnerabilities
|
|
3
|
+
mode: subagent
|
|
4
|
+
tools:
|
|
5
|
+
write: false
|
|
6
|
+
edit: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a security expert. Focus on identifying potential security issues.
|
|
10
|
+
|
|
11
|
+
Look for:
|
|
12
|
+
|
|
13
|
+
- Input validation vulnerabilities
|
|
14
|
+
- Authentication and authorization flaws
|
|
15
|
+
- Data exposure risks
|
|
16
|
+
- Dependency vulnerabilities
|
|
17
|
+
- Configuration security issues
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Decompose a large migration or refactor into parallel worker tasks, each reviewed with /simplify and submitted as an independent PR
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Decompose the following work into parallel worker tasks and execute them: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
## How to Use
|
|
8
|
+
|
|
9
|
+
Describe the overall goal. `/batch` will plan and parallelize the work:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
/batch Migrate all lodash usages to native equivalents
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/batch Add type annotations to all untyped function parameters in src/
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/batch Replace deprecated API calls across the codebase with v2 equivalents
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Three Phases
|
|
24
|
+
|
|
25
|
+
### Phase 1 — Research and Plan
|
|
26
|
+
|
|
27
|
+
Explore the affected files, decompose the work into independent units (typically 5–30 tasks), and determine how to verify each one. Tasks that can be done independently are parallelized; tasks with dependencies are ordered correctly.
|
|
28
|
+
|
|
29
|
+
### Phase 2 — Spawn Workers
|
|
30
|
+
|
|
31
|
+
One background agent per task unit, each running in an isolated git worktree. Every agent:
|
|
32
|
+
|
|
33
|
+
1. Implements its task fully.
|
|
34
|
+
2. Runs `/simplify` on its changes (Code Reuse → Code Quality → Efficiency review).
|
|
35
|
+
3. Executes tests to verify correctness.
|
|
36
|
+
4. Commits and opens a pull request.
|
|
37
|
+
|
|
38
|
+
Each worker operates independently — if one fails, the others keep going. Every PR is independently mergeable.
|
|
39
|
+
|
|
40
|
+
### Phase 3 — Track Progress
|
|
41
|
+
|
|
42
|
+
A status table updates as workers complete, showing which PRs are ready for review.
|
|
43
|
+
|
|
44
|
+
## When to Use `/batch`
|
|
45
|
+
|
|
46
|
+
**Good for:**
|
|
47
|
+
|
|
48
|
+
- Framework migrations (e.g. class components → hooks, lodash → native)
|
|
49
|
+
- API contract updates across all callers
|
|
50
|
+
- Convention enforcement across a codebase
|
|
51
|
+
- Dependency replacements
|
|
52
|
+
- Test generation for untested modules
|
|
53
|
+
|
|
54
|
+
**Not for:**
|
|
55
|
+
|
|
56
|
+
- Tightly coupled changes that require coordination between units
|
|
57
|
+
- Exploratory refactoring where you don't yet know the target shape
|
|
58
|
+
- Single-file modifications (use `/simplify` instead)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Review recently modified code from three perspectives (Code Reuse, Code Quality, Efficiency) and apply all findings
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Review the recently modified code ($ARGUMENTS or `git diff --name-only` if no argument is given) from three distinct perspectives, then apply all actionable findings.
|
|
6
|
+
|
|
7
|
+
## Three Review Perspectives
|
|
8
|
+
|
|
9
|
+
Work through each perspective independently before making any edits, so findings from all three are considered together:
|
|
10
|
+
|
|
11
|
+
### 1. Code Reuse
|
|
12
|
+
|
|
13
|
+
Look for:
|
|
14
|
+
|
|
15
|
+
- Logic duplicated across two or more places that could share a single implementation
|
|
16
|
+
- Redundant patterns that could be consolidated
|
|
17
|
+
- Helper functions or utilities that already exist in the codebase but were re-implemented
|
|
18
|
+
|
|
19
|
+
### 2. Code Quality
|
|
20
|
+
|
|
21
|
+
Look for:
|
|
22
|
+
|
|
23
|
+
- Readability problems: confusing variable/function names, deeply nested blocks, long functions
|
|
24
|
+
- Structural concerns: responsibilities mixed in a single function or module, missing abstractions
|
|
25
|
+
- Style inconsistencies relative to the surrounding codebase
|
|
26
|
+
|
|
27
|
+
### 3. Efficiency
|
|
28
|
+
|
|
29
|
+
Look for:
|
|
30
|
+
|
|
31
|
+
- Performance bottlenecks: N+1 queries, redundant loops, repeated expensive computations
|
|
32
|
+
- Unnecessary computation that can be eliminated or cached
|
|
33
|
+
- Wasted work: operations whose results are never used
|
|
34
|
+
|
|
35
|
+
## Process
|
|
36
|
+
|
|
37
|
+
1. **Identify the target files**: Use `$ARGUMENTS` as the file path or scope. If empty, run `git diff --name-only` to get recently modified files.
|
|
38
|
+
2. **Apply all three review lenses**: Analyze the code from each perspective above and collect all findings before editing anything.
|
|
39
|
+
3. **Apply fixes**: Work through the combined findings and apply all actionable improvements surgically, preserving functionality.
|
|
40
|
+
4. **Verify**: Confirm the code still builds and tests pass after changes.
|
|
41
|
+
|
|
42
|
+
## What NOT to Change
|
|
43
|
+
|
|
44
|
+
- Comments that explain non-obvious business logic or architecture decisions
|
|
45
|
+
- Abstractions used in multiple places that genuinely reduce duplication
|
|
46
|
+
- Error handling that matches patterns used elsewhere in the codebase
|
|
47
|
+
- Public API boundaries that other code depends on
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3
|
+
"agent": {
|
|
4
|
+
"build": {
|
|
5
|
+
"permission": {
|
|
6
|
+
"bash": {
|
|
7
|
+
"$HOME/.claude/skills/qmd-knowledge/scripts/record.sh": "allow",
|
|
8
|
+
"$HOME/.config/opencode/skills/qmd-knowledge/scripts/record.sh": "allow",
|
|
9
|
+
"git push": "ask",
|
|
10
|
+
"qmd": "allow",
|
|
11
|
+
"qmd get": "allow",
|
|
12
|
+
"qmd query": "allow",
|
|
13
|
+
"qmd search": "allow"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"default_agent": "plan",
|
|
19
|
+
"formatter": {
|
|
20
|
+
"biome": {
|
|
21
|
+
"command": ["biome", "check", "--write", "$FILE"],
|
|
22
|
+
"extensions": [".ts", ".tsx", ".js", ".jsx"]
|
|
23
|
+
},
|
|
24
|
+
"gofmt": {
|
|
25
|
+
"command": ["gofmt", "-w", "$FILE"],
|
|
26
|
+
"extensions": [".go"]
|
|
27
|
+
},
|
|
28
|
+
"prettier": {
|
|
29
|
+
"command": ["npx", "prettier", "--write", "$FILE"],
|
|
30
|
+
"extensions": [".md", ".mdx"]
|
|
31
|
+
},
|
|
32
|
+
"ruff": {
|
|
33
|
+
"command": ["ruff", "format", "$FILE"],
|
|
34
|
+
"extensions": [".py"]
|
|
35
|
+
},
|
|
36
|
+
"rustfmt": {
|
|
37
|
+
"command": ["rustfmt", "$FILE"],
|
|
38
|
+
"extensions": [".rs"]
|
|
39
|
+
},
|
|
40
|
+
"shfmt": {
|
|
41
|
+
"command": ["shfmt", "-w", "$FILE"],
|
|
42
|
+
"extensions": [".sh"]
|
|
43
|
+
},
|
|
44
|
+
"stylua": {
|
|
45
|
+
"command": ["stylua", "$FILE"],
|
|
46
|
+
"extensions": [".lua"]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"instructions": [
|
|
50
|
+
"~/.config/opencode/aas-setup/best-practices.md",
|
|
51
|
+
"~/.config/opencode/aas-setup/MEMORY.md",
|
|
52
|
+
"~/.config/opencode/aas-setup/agent-memory.md"
|
|
53
|
+
],
|
|
54
|
+
"mcp": {
|
|
55
|
+
"agentmemory": {
|
|
56
|
+
"command": ["npx", "-y", "@agentmemory/mcp"],
|
|
57
|
+
"enabled": true,
|
|
58
|
+
"environment": {
|
|
59
|
+
"AGENTMEMORY_SECRET": "${AGENTMEMORY_SECRET:-}",
|
|
60
|
+
"AGENTMEMORY_TOOLS": "${AGENTMEMORY_TOOLS:-all}",
|
|
61
|
+
"AGENTMEMORY_URL": "${AGENTMEMORY_URL:-http://localhost:3111}"
|
|
62
|
+
},
|
|
63
|
+
"type": "local"
|
|
64
|
+
},
|
|
65
|
+
"context7": {
|
|
66
|
+
"command": ["npx", "-y", "@upstash/context7-mcp@latest"],
|
|
67
|
+
"enabled": true,
|
|
68
|
+
"type": "local"
|
|
69
|
+
},
|
|
70
|
+
"fff": {
|
|
71
|
+
"command": ["fff-mcp"],
|
|
72
|
+
"enabled": true,
|
|
73
|
+
"type": "local"
|
|
74
|
+
},
|
|
75
|
+
"logpilot": {
|
|
76
|
+
"command": ["logpilot", "mcp-server"],
|
|
77
|
+
"enabled": true,
|
|
78
|
+
"type": "local"
|
|
79
|
+
},
|
|
80
|
+
"qmd": {
|
|
81
|
+
"command": ["qmd", "mcp"],
|
|
82
|
+
"enabled": true,
|
|
83
|
+
"type": "local"
|
|
84
|
+
},
|
|
85
|
+
"react-grab-mcp": {
|
|
86
|
+
"command": ["npx", "-y", "@react-grab/mcp", "--stdio"],
|
|
87
|
+
"enabled": true,
|
|
88
|
+
"type": "local"
|
|
89
|
+
},
|
|
90
|
+
"sem": {
|
|
91
|
+
"command": ["sem-mcp"],
|
|
92
|
+
"enabled": true,
|
|
93
|
+
"type": "local"
|
|
94
|
+
},
|
|
95
|
+
"sequential-thinking": {
|
|
96
|
+
"command": ["npx", "-y", "@modelcontextprotocol/server-sequential-thinking"],
|
|
97
|
+
"enabled": true,
|
|
98
|
+
"type": "local"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"model": "opencode/big-pickle",
|
|
102
|
+
"plugin": ["@plannotator/opencode@latest", "opencode-chrome-annotation@latest"],
|
|
103
|
+
"provider": {
|
|
104
|
+
"llama.cpp": {
|
|
105
|
+
"models": {
|
|
106
|
+
"glm": {
|
|
107
|
+
"limit": {
|
|
108
|
+
"context": 32768,
|
|
109
|
+
"output": 16384
|
|
110
|
+
},
|
|
111
|
+
"name": "GLM-4.7-Flash (local)"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"name": "llama-server (local)",
|
|
115
|
+
"npm": "@ai-sdk/openai-compatible",
|
|
116
|
+
"options": {
|
|
117
|
+
"baseURL": "http://192.168.1.11:8000/v1"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"ollama": {
|
|
121
|
+
"models": {
|
|
122
|
+
"minimax-m2.5:cloud": {
|
|
123
|
+
"limit": {
|
|
124
|
+
"context": 204800,
|
|
125
|
+
"output": 128000
|
|
126
|
+
},
|
|
127
|
+
"name": "minimax-m2.5:cloud"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"name": "Ollama (local)",
|
|
131
|
+
"npm": "@ai-sdk/openai-compatible",
|
|
132
|
+
"options": {
|
|
133
|
+
"baseURL": "http://127.0.0.1:11434/v1"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 🤖 Pi Agent Guidelines
|
|
2
|
+
|
|
3
|
+
## language
|
|
4
|
+
must reponse in chinese
|
|
5
|
+
|
|
6
|
+
## network
|
|
7
|
+
|
|
8
|
+
If facing a network problem,use proxy 127.0.0.1:7890(first) or 192.168.1.254:7890
|
|
9
|
+
|
|
10
|
+
## Session Management with tmux
|
|
11
|
+
|
|
12
|
+
Run dev servers, tests, and interactive CLIs inside tmux with the **current directory name as the session name** for easy debugging:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
SESSION=$(basename "$PWD")
|
|
16
|
+
tmux new -d -s "$SESSION" 2>/dev/null || true
|
|
17
|
+
|
|
18
|
+
# Run dev server with portless if available, otherwise fallback to npm
|
|
19
|
+
if command -v portless &>/dev/null; then
|
|
20
|
+
tmux send-keys -t "$SESSION" 'portless run npm run dev' Enter
|
|
21
|
+
else
|
|
22
|
+
tmux send-keys -t "$SESSION" 'npm run dev' Enter
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
tmux capture-pane -p -t "$SESSION" -S -20 # check output
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
See @~/.pi/agent/aas-setup/best-practices.md for full details.
|
|
29
|
+
|
|
30
|
+
## 🔧 AI Tool Guidelines
|
|
31
|
+
|
|
32
|
+
- Use the fff MCP tools for all file search operations instead of default tools.
|
|
33
|
+
- Use the sem MCP tools for semantic version control and git operations.
|
|
34
|
+
- When using bash commands for file/content search, prefer `fd` (fdfind) and `rg` (ripgrep) over standard `find` and `grep` for better performance and git-awareness.
|
|
35
|
+
|
|
36
|
+
## 📋 General Practices
|
|
37
|
+
|
|
38
|
+
- Follow my software development practice @~/.pi/agent/aas-setup/best-practices.md
|
|
39
|
+
- Read @~/.pi/agent/aas-setup/MEMORY.md first — qmd (durable) vs agentmemory (session); follow the decision rule there
|
|
40
|
+
- Read @~/.pi/agent/aas-setup/agent-memory.md — auto-capture learnings, persist bug fixes, keep memories concise.
|
|
41
|
+
- Follow git safety guidelines @~/.pi/agent/aas-setup/git-guidelines.md
|
|
42
|
+
- Keep responses concise and actionable.
|
|
43
|
+
- Never run destructive commands.
|
|
44
|
+
- Use our conventions for file names, tests, and commands.
|
|
45
|
+
- Keep your code clean and organized. Do not over-engineer solutions or overcomplicate things unnecessarily.
|
|
46
|
+
- Write clear and concise code. Avoid unnecessary complexity and redundancy.
|
|
47
|
+
- Use meaningful variable and function names.
|
|
48
|
+
- Prefer self-documenting code. Write comments and documentation where necessary.
|
|
49
|
+
- Keep your code modular and reusable. Avoid tight coupling and excessive dependencies.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"context7": {
|
|
4
|
+
"command": "npx",
|
|
5
|
+
"args": ["-y", "@upstash/context7-mcp@latest"]
|
|
6
|
+
},
|
|
7
|
+
"sequential-thinking": {
|
|
8
|
+
"command": "npx",
|
|
9
|
+
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
|
|
10
|
+
},
|
|
11
|
+
"qmd": {
|
|
12
|
+
"command": "qmd",
|
|
13
|
+
"args": ["mcp"]
|
|
14
|
+
},
|
|
15
|
+
"agentmemory": {
|
|
16
|
+
"command": "npx",
|
|
17
|
+
"args": ["-y", "@agentmemory/mcp"]
|
|
18
|
+
},
|
|
19
|
+
"sem": {
|
|
20
|
+
"command": "sem-mcp",
|
|
21
|
+
"args": []
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collapseChangelog": true,
|
|
3
|
+
"defaultModel": "deepseek/deepseek-v4-pro",
|
|
4
|
+
"defaultThinkingLevel": "high",
|
|
5
|
+
"editorPaddingX": 1,
|
|
6
|
+
"hideThinkingBlock": true,
|
|
7
|
+
"lastChangelogVersion": "0.79.10",
|
|
8
|
+
"packages": [
|
|
9
|
+
{
|
|
10
|
+
"skills": [],
|
|
11
|
+
"source": "npm:@plannotator/pi-extension"
|
|
12
|
+
},
|
|
13
|
+
"npm:@tintinweb/pi-subagents",
|
|
14
|
+
"npm:@ff-labs/pi-fff",
|
|
15
|
+
"npm:pi-mcp-adapter",
|
|
16
|
+
"npm:pi-simplify",
|
|
17
|
+
"npm:@tintinweb/pi-tasks",
|
|
18
|
+
"npm:pi-btw",
|
|
19
|
+
"npm:pi-code-previews",
|
|
20
|
+
"npm:pi-codex-goal",
|
|
21
|
+
"npm:pi-dynamic-workflows",
|
|
22
|
+
"npm:pi-footer",
|
|
23
|
+
"npm:pi-tps-meter",
|
|
24
|
+
"npm:@juicesharp/rpiv-advisor",
|
|
25
|
+
"npm:pi-web-access",
|
|
26
|
+
"npm:@juicesharp/rpiv-ask-user-question"
|
|
27
|
+
],
|
|
28
|
+
"permissionLevel": "high",
|
|
29
|
+
"quietStartup": true,
|
|
30
|
+
"theme": "kanagawa",
|
|
31
|
+
"treeFilterMode": "default",
|
|
32
|
+
"terminal": {
|
|
33
|
+
"showTerminalProgress": true
|
|
34
|
+
},
|
|
35
|
+
"enableInstallTelemetry": false,
|
|
36
|
+
"defaultProjectTrust": "always"
|
|
37
|
+
}
|