Personal Investment Assistant Initialization
This Skill is not a website design consultant, nor does it discuss page layout from scratch. The repository already provides a runnable application with React, Express, SQLite, a cron scheduler, and real Provider integrations. The task of this Skill is to configure this application according to the user's actual investment preferences, and deliver a website that immediately displays personalized content upon opening.
Remote Skill Entry
Users may trigger this process directly via the public Skill URL below, without first cloning the repository or installing the Skill:
https://github.com/3494036618-eng/personal-investment-assistant/blob/v0.3.0/skills/investment-assistant/SKILL.md
If the file {baseDir}/scripts/status.mjs does not exist in the current environment, it means this Skill was opened from the remote URL. In that case, Codex or Claude Code must:
- Fetch the complete repository
https://github.com/3494036618-eng/personal-investment-assistant, not just theSKILL.mdfile. - Set
{baseDir}to theskills/investment-assistantdirectory within the repository. - Verify that
{baseDir}/scripts/,{baseDir}/references/, and theapp/directory at the repository root all exist before proceeding to Stage 0. - If a directory with the same name already exists, verify the Git remote and workspace state first, do not overwrite user changes, and do not create a second copy of the application.
- If the current client is Codex, run
npm run skill:install:codexin the repository root; if the current client is Claude Code, runnpm run skill:install:claude. The installation writes only to the specific client's personal Skill directory. - After installation, use the Skill directly from the fetched repository to continue initialization. Do not claim that "the website is ready" just because "the Skill has been copied".
Users can directly provide the following text to Codex or Claude Code, which supports networking and terminal operations:
Help me initialize the Personal Investment Assistant: https://github.com/3494036618-eng/personal-investment-assistant/blob/v0.3.0/skills/investment-assistant/SKILL.md
Once installed, Codex can trigger it via $investment-assistant, and Claude Code can trigger it via /investment-assistant. Both entry points execute the same set of initialization and acceptance rules.
Completion Criteria
Only when all of the following items are completed can it be said that "it is ready to use":
- At least one real security's name, code, and market have been confirmed.
- The user's focus areas have been confirmed for each security, preserving the user's exact wording.
- Whether automatic after-hours monitoring is enabled has been confirmed; if enabled, the time, day(s), and timezone have been confirmed.
- The Agent Plan Key has been written using secure local credential configuration, and has not appeared in chat, source code, or logs.
- Real probes for DataPro, Doubao Search, and the Agent Plan model have all been successful.
- The complete frontend and backend have been installed and started.
- The user's configuration has been imported, and the homepage is not a blank watchlist.
- After the user consents to consuming real quota, at least one Individual Stock Brief and one After-Hours Risk Summary have been generated for each stock.
- Both types of reports have substantive content, corresponding sources, and independent historical records.
- Desktop core paths have passed browser checks.
If any item is not completed, accurately state which step was stopped at, what has been completed, and what the next step is. Do not use old results, Mock data, or verbal judgments as substitutes.
Working Principles
- Do not discuss website layout: The existing website's pages, structure, and functional boundaries are fixed. Only collect the investment configurations needed to use it.
- Confirm configuration before calling: First, present a structured configuration summary to the user. Proceed with installation, import, and consumption of real service quota only after the user has confirmed.
- Do not guess real securities: If the name, code, or market is uncertain, verify first. If verification is impossible, ask the user to provide the information. Do not map to similar companies.
- Bind preferences per security: Different stocks can have completely different focus areas. All user-specified preferences are entered into the Profile verbatim. Do not use only preset keywords.
- Immediate content upon opening: The default initialization generates the first two reports for each stock. Use the empty report mode only if the user explicitly requests to skip generation temporarily.
- All three capabilities use the same Agent Plan Key: According to the current Agent Plan Harness configuration, the same Key is used by default for the model, DataPro, and Doubao Search. Do not ask the user to provide a separate search key.
- Bind sources to content: DataPro handles structured professional data; Doubao Search handles the latest publicly available information; the Agent Plan model generates and reviews content based only on the evidence gathered in this session.
- Different responsibilities for the two report types: The Individual Stock Brief answers "How is the company doing currently". The After-Hours Risk Summary answers "What new changes and risk signals have appeared during this check window".
- Do not echo sensitive information: Keys can only be configured via hidden terminal input, environment variables, or local credential files with permissions
0600. - Explain every step: State what was just completed, which step is currently being executed, what the next step will be, and whether dependencies will be downloaded or quota consumed.
Process Overview
| Stage | Action | Completion Marker |
|---|---|---|
| 0 | Check current state | Confirm first-time initialization, resume operation, or fault diagnosis |
| 1 | Collect investment configuration | Stocks, codes, markets, preferences, and monitoring schedule are complete |
| 2 | User confirms configuration | User explicitly agrees to the structured summary |
| 3 | Installation and secure configuration | Formal application installation complete, Key securely written |
| 4 | Real service probes | All three Providers are currently available |
| 5 | Import personalized configuration | User stocks and focus areas are visible on the homepage |
| 6 | Generate initial reports | Each stock has two types of real reports and history |
| 7 | Browser acceptance and delivery | User can directly open and use the website |
Stage 0: Check Current State
First, check Node.js, Skill files, runtime, and website status:
node {baseDir}/scripts/status.mjs
- Application not installed: Proceed to Stage 1.
- Installed but not running: Still confirm user configuration first, then decide whether to start or update.
- Already running: Read existing watchlist and configuration. If the user is only adding new targets, do not clear existing data.
ready=false: The subsequent steps must re-execute a real doctor check. Do not assume the backend is available based on process liveness alone.
Do not ask the user for the website source code directory, and do not create another project copy.
Stage 1: Collect Investment Configuration
Use a one-to-two-question-per-round approach. Avoid presenting a long form to the user all at once. Collect at least:
- Security name.
- Security code.
- Market:
CN,HK, orUS. - The focus areas for this security (suggest 2 to 6 items, but defer to the user's actual needs).
- Whether to enable automatic after-hours monitoring.
- If enabled, the execution time, execution day(s), and timezone.
You can start by asking:
Which stocks are you interested in? Please tell me the security name, code, and market. Then, I'll confirm the specific aspects you truly care about for each one and write these preferences directly into the website.
Focus areas cannot be limited to a fixed vocabulary list. The following are just examples to help users express their needs, not an allowlist:
- Market & Technicals: Price trend, volume, volatility, key price levels, capital flow changes.
- Business & Financials: Revenue, profit, cash flow, gross margin, R&D, dividends, debt.
- Company Events: Announcements, orders, products, capacity, management, litigation, regulation.
- Industry & External Environment: Competition, policy, raw materials, exchange rates, interest rates, overseas risks.
- User's own natural language, e.g., "High-end liquor wholesale prices and channel inventory" or "Progress of overseas key customer qualification".
Compound preferences can be retained verbatim. The application will perform semantic decomposition and coverage assessment during retrieval. Do not rewrite them for the sake of adapting to preset keywords.
Security Verification
Prefer using DataPro to query the correspondence between name, code, and market. When a direct tool is not available, do not guess. After real services are ready, use the verification in the first report's security attribution as a blocking gate. For CN/HK stocks, keep the exchange's common format for the code. For US stocks, use the public Ticker.
Stage 2: Confirm Structured Configuration
Compile the discussion results into a brief summary for the user to explicitly confirm. Example:
Initialization Configuration
1. Kweichow Moutai | 600519 | CN
Focus: Profitability, Brand Strength, Channel Inventory, Industry Dynamics
After-Hours Monitoring: Working days 18:00, Asia/Shanghai
2. Apple | AAPL | US
Focus: iPhone Sales, Services Business, AI Product Progress
After-Hours Monitoring: Disabled
After confirmation, I will install and start the existing website, import these configurations, and realistically generate an Individual Stock Brief and an After-Hours Risk Summary for each stock. This step will call DataPro, Doubao Search, and the Agent Plan model, consuming plan quota.
Proceed only after the user has explicitly confirmed. If the user modifies an item, update only that specific item and present the complete summary again.
Write the confirmed result to a temporary Profile with permissions 0600. Format:
{
"stocks": [
{
"name": "Kweichow Moutai",
"code": "600519",
"exchange": "CN",
"focus": ["Profitability", "Brand Strength", "Channel Inventory", "Industry Dynamics"],
"monitor": {
"enabled": true,
"schedule_time": "18:00",
"schedule_days": ["Mon", "Tue", "Wed", "Thu", "Fri"],
"timezone": "Asia/Shanghai"
}
}
]
}
The Profile must not contain the API Key. Delete the temporary file after use by using --consume-profile.
Stage 3: Install Application and Configure Agent Plan
Explain that this step will copy the official application, install npm dependencies, run checks and production build, then execute:
node {baseDir}/scripts/install.mjs
If credentials are missing, execute in an interactive terminal:
node {baseDir}/scripts/configure.mjs
configure.mjs only asks for one Agent Plan API Key and writes it securely to:
~/.config/investment-assistant/credentials.env
The file permissions must be 0600. Do not ask the user to send the Key in chat. Do not write the Key into the Profile, .env.example, README, or source code.
Stage 4: Real Probes for Three Providers
Execute:
node {baseDir}/scripts/doctor.mjs --live
Must see:
agent_plan_model: okdatapro: okweb_search: ok
This step will generate a small amount of real calls. If any check fails, handle it according to references/troubleshooting.md and stop here. Do not proceed with report generation, and do not claim that "the backend is available" just because "the Key is configured".
Stage 5: Import User Configuration
Start the website and import the confirmed Profile:
node {baseDir}/scripts/start.mjs
node {baseDir}/scripts/profile.mjs --input /absolute/path/to/private/profile.json --consume-profile
Import is idempotent based on market and security code. Existing stocks retain their history; repeated execution does not create duplicate targets.
Check that the homepage meets at least these criteria:
- Each user security exists.
- Name, code, and market are correct.
- Cards display the user-entered focus areas.
- After-hours settings match user confirmation.
Stage 6: Generate Initial Personalized Reports
When the user agreed to consume quota in Stage 2, execute a full initial generation:
node {baseDir}/scripts/acceptance.mjs --all --seed
--seed generates for each stock:
- One Individual Stock Brief.
- One After-Hours Risk Summary.
And automatically checks:
- The two report types have different IDs and independent evidence snapshots.
- The two report types do not duplicate the same online URL.
- The Individual Stock Brief contains verifiable core financial DataPro evidence.
- The evidence IDs referenced in the text all exist.
- Online sources have real titles, publishers, URLs, and summaries.
- Coverage status exists for each user preference item.
- The two report types enter their respective historical records.
If the user explicitly requests to skip generating the initial reports, only a basic acceptance check can be performed:
node {baseDir}/scripts/acceptance.mjs --all
In this case, you must explain that "the website is configured, but the report section may still be empty". Do not claim that the user can open it and see content immediately.
The minimal one-step initialization command is:
node {baseDir}/scripts/onboard.mjs \
--profile /absolute/path/to/private/profile.json \
--consume-profile
This command installs, configures, performs real probes, starts the app, imports, and generates initial reports by default. Only add --skip-initial-reports if the user explicitly requests not to generate them.
Stage 7: Desktop Browser Acceptance
Open the local address output by the script. Default:
http://127.0.0.1:8788
Check following a real user flow:
- Homepage is not blank; all securities and focus areas are visible.
- Opening "Individual Stock Brief" shows the saved initial report first.
- Content is structured as "Market Performance, Business & Financials, Focus Areas, Subsequent Observations", not just concatenated fields.
- Citation section aligns with numbers in the text; online sources are clickable; DataPro sources do not show traces.
- Opening "After-Hours Risk Summary" shows an independent report, not reusing the brief's text or sources.
- After-hours settings can be saved; "Run Once Now" can generate a new record.
- If automatic monitoring is enabled, the next execution time is correct; the scheduler service status is normal.
- History records contain all generated reports.
- No page overflow, occlusion, obvious line break issues, or console errors.
A visible page in the browser does not equal a real backend being available. Only deliver when all three criteria are met: real doctor check, report generation, and browser path checks.
Fixed Boundaries for Individual Stock Brief and After-Hours Risk Summary
Individual Stock Brief
Answers "How is the company doing currently", using current market data, the latest available financials, and public materials related to the user's focus areas. Fixed structure:
- Summary: Concise conclusion, not a concatenation of all sections.
- Market Performance.
- Business & Financials.
- Focus Areas.
- Subsequent Observations.
After-Hours Risk Summary
Answers "What happened during this check window", using the day's market anomalies, new company events since the last check, and recent external risk context. Fixed structure:
- Summary: Risk changes and the most important fact, no repetition of all sections.
- Market Anomalies.
- Company Events.
- External Risks.
- Subsequent Observations.
If there is no qualified evidence for a section, that section can be omitted. However, do not fill it with vague statements like "No findings" or "Continue monitoring". The absence of new risk events does not mean the company has no risks; still save the auditable results from this session.
Troubleshooting
- Website not started: Run
status.mjs, then runstart.mjs. ready=false: Re-rundoctor.mjs --live.- New stock has no content: Confirm Profile import was successful, then run
acceptance.mjs --stock <code> --seedfor that stock. - Cron job not executing: Check monitor switch, day, time, timezone, scheduler service status, and execution log.
- Report generation failed: Retain specific error and diagnostic logs. Handle based on Provider issues, security attribution, evidence coverage, or model review problems. Do not skip checks.
- Update application: Backup first, then stop, install, start, and re-execute doctor. Database and credentials are not deleted during the update.
Detailed configuration is in references/setup.md, acceptance rules in references/acceptance.md, evidence policy in references/evidence-policy.md, and troubleshooting in references/troubleshooting.md.
Final Delivery Notes
The final response must explicitly list:
- The website address and current process status.
- The imported securities, markets, and focus areas.
- The after-hours monitor on/off status, time, day(s), and timezone for each security.
- Real probe results for the Agent Plan model, DataPro, and Doubao Search.
- Whether an Individual Stock Brief and After-Hours Risk Summary have been generated for each security.
- Whether the history records and scheduler status have passed checks.
- The checks, tests, builds, and browser acceptance that were actually performed.
- Uncompleted items, external dependencies, and risks that still require manual verification.
Do not just say "Initialization complete". The user needs to know what they can do now, which results have been verified with real calls, and which results remain unverified.