Input Routing
- First identify the attachments, file paths, worksheets and user goals actually accessible in this conversation; do not treat historical files, sample data or materials not provided as this input.
- When per-note attachments have been provided, enter "Attachment Direct-Read Mode"; fully read references/attachment-input-and-evidence.md and references/attachment-analysis-and-output.md, without launching a browser.
- When the user asks to analyze "based on the attachments" but there are no accessible attachments this time, stop and output
ATTACHMENT_REQUIRED, and ask the user to upload them or give an explicit path; do not continue the analysis from model memory. - When the user asks to collect samples from Xiaohongshu, or explicitly states that no ready-made data is available, enter "Collection Research Mode".
- When the input intent truly cannot be determined, ask only one routing question: analyze existing attachments, or collect public samples first.
Attachment Direct-Read Mode
- List the actual attachment file names, formats, worksheets, raw row counts and units of observation, and state "the following analysis is based only on the attachments provided this time".
- First run
scripts/analyze_attachment.pyto complete field mapping, deduplication, missing-rate, engagement metrics, 10%/30%/60% stratification, numerical feature correlation and Tag statistics; do not use language-model mental arithmetic in place of reproducible statistics. - Deliver the field capability matrix first. Modules with insufficient fields must state "cannot be determined" and the missing fields; do not fill gaps with industry common sense.
- Complete semantic coding of content type, title structure, emotional intensity, user needs, opening hooks, value presentation, trust methods and closing actions in batches using a fixed scale; save the per-note coding together with
note_idor the source row number, then aggregate the proportions. - Output the evidence table, complete analysis and optional research validation draft according to references/attachment-analysis-and-output.md . Present strategy drafts separately from sample facts.
- Local read-only checks, statistics and local report output already requested by the user do not require "confirm execution"; browsing to supplement data, Feishu writes or other external actions still require separate confirmation per the corresponding rules.
Dynamically resolve the script path from the current Skill directory, and explicitly specify the derived output directory:
python3 <skill-dir>/scripts/analyze_attachment.py <attachment> --output-dir <derived-output-dir>
When XLSX has multiple worksheets, add --sheet <sheet-name>. The script outputs analysis-summary.json、cleaned-notes.csv and semantic-coding-template.csv; the original attachment remains read-only.
Collection Research Mode
- On first use or when information is incomplete, first read references/client-onboarding.md, confirm the decision question in business language the client can understand, and then define the sample.
- Output [Identified] [Needs Confirmation] [Temporarily Using Defaults], asking at most 3 key questions per round; after completion, first generate the [Client Configuration Card], then read references/intake-and-sample-definition.md to generate the [Research Execution Confirmation Form].
- Before an explicit "confirm execution" is received, do not browse in batches, create scheduled tasks, or write to Feishu.
- After confirmation, first fully read references/browser-executors.md, select and verify the browser executor, then follow references/batch-and-checkpoint.md to collect serially at low frequency, in batches, and save checkpoints.
- Save the structured samples, failure records and data quality information according to references/dataset-schema.md .
- After all batches have finished or been interrupted, follow references/analysis-and-report.md Clean, analyze and deliver; when Feishu is involved, first fully read references/feishu-cli-policy.md, and only execute through
lark-cli.
Research principles
- The default unit of observation is a single public Xiaohongshu note.
- "Browse N candidate notes" and "ultimately retain N valid samples" are different goals; when the user has not specified, this must be confirmed.
- All stratification is based on samples that actually meet the criteria, not on target quantities.
- Changes to sample criteria change the research scope; lowering thresholds, expanding keywords or extending the time range must be re-confirmed beforehand.
- Distinguish [facts] [derived] [sample-based inferences] [to be verified]; variable associations must not be written as causation or "contribution".
- Report conclusions must simultaneously disclose sample size, missing-data proportion, keyword sources, collection bias and platform limitations.
- Percentages must be traceable to the numerator, denominator and sample scope; cases must come from the current attachments or the samples collected in this run.
- Platform-level or predictive conclusions such as "best posting time", "low-competition tags" and "expected engagement" can only be valid when corresponding external baselines or historically validated data exist.
Platform and browser boundaries for collection mode
- Only read public pages and content visible under the user's existing login state.
- Access serially at low frequency; do not scan pages concurrently; do not collect personal sensitive information unrelated to the research.
- Do not like, favorite, follow, comment, send direct messages or auto-publish.
- Do not request passwords, cookies, tokens or browser configurations, and do not bypass CAPTCHAs, login walls or risk controls.
- Only close tabs created in this run.
- By default use Codex's built-in Chrome control capability;
web-accessserves only as a candidate fallback executor when the primary executor has a non-policy technical failure. - When the primary executor fails, first save a checkpoint, preserve the original error and classify it according to
browser-executors.md. Switch to the fallback executor only if switch conditions are met and the confirmation sheet has pre-authorized it or the user has separately given explicit consent. - Before using
web-access, dynamically discover and fully read itsSKILL.mdfrom the current runtime environment, and perform the prerequisite checks and risk notices it requires; never hard-code absolute paths for any machine. - Explicit browser security, network, organizational, domain or platform policy denials, as well as login walls, CAPTCHAs and risk controls, must not be retried for the same access through
web-accessor other channels. - Whichever browser executor is used, continue to execute serially at low frequency and do not scan pages in parallel; Feishu operations must not switch to a browser, connector or direct API.
Scale assessment
- Target over 100 notes: first explain that this is a long task and confirm batches, progress saving, duration and risk-control limits.
- Target 200–300 notes: do not promise that a single run will necessarily complete.
- For large-scale data needed stably over the long term: recommend first evaluating authorized data sources or compliant data services.
Client delivery rules
- By default, treat the user as a business client doing structured competitive research for the first time; explain the business choices first, and do not immediately present field tables or technical parameters.
- When the client only invokes this Skill, says "start research" or says "use the recommended settings" and provides no attachments, the collection-mode first-time guidance must be entered.
- The difference between candidate browsing volume and final valid sample volume must be explained with examples; do not merely let the client choose between the two terms.
- Show customers natural-language statuses such as "setting up, awaiting confirmation, collecting in batches, organizing reports, customer action required, completed," and do not expose internal status codes or checkpoint paths on their own.
- New tasks cannot be guaranteed to automatically inherit old settings; after completion, output a copyable [Customer Configuration Card] and do not claim that it has been permanently saved.
Completion criteria
The attachment direct-read mode must deliver the attachment list, actual valid sample size, duplicates and missing values, executable/non-executable modules, interaction definitions, evidence index, and locations of the report and derived files. The collection research mode must deliver the actual sample size that met the target, number of failures and skips, execution batches, data missingness, limitations, report location, and Feishu status. If interrupted, retain the checkpoint and state the last successful batch and the conditions for continuing.