ssci-subagent-skills 1.0.0
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/CHANGELOG.md +195 -0
- package/LICENSE +21 -0
- package/README.md +529 -0
- package/agents/LITERATURE_EXPERT_INTEGRATION_SUMMARY.md +618 -0
- package/agents/LITERATURE_EXPERT_INTEGRATION_UPDATE.md +284 -0
- package/agents/__pycache__/literature_expert_integration.cpython-312.pyc +0 -0
- package/agents/ant-expert-main.md +127 -0
- package/agents/ant-expert.md +301 -0
- package/agents/chinese-localization-expert.md +261 -0
- package/agents/core_engine.py +375 -0
- package/agents/digital-ecosystem-analyst/digital-ecosystem-analyst.py +507 -0
- package/agents/digital-marx-expert.md +373 -0
- package/agents/digital-transformation-ecosystem-analyst/digital-transformation-ecosystem-analyst.md +76 -0
- package/agents/digital-transformation-innovation-analyst/DATA_CONSTITUTION_REALITY_VERIFIED.py +233 -0
- package/agents/digital-transformation-innovation-analyst/DATA_CONSTITUTION_SKILL_SPECIFICATION.md +357 -0
- package/agents/digital-transformation-innovation-analyst/README_AGENTSILLS_IO_STANDARD.md +418 -0
- package/agents/digital-transformation-innovation-analyst/digital-transformation-innovation-analyst.md +469 -0
- package/agents/digital-transformation-innovation-analyst/digital-transformation-innovation-analyst.py +513 -0
- package/agents/digital-transformation-innovation-analyst/digital-transformation-innovation-analyst_DATA_CONSTITUTION.md +299 -0
- package/agents/digital-transformation-innovation-analyst/digital-transformation-innovation-analyst_DATA_CONSTITUTION.py +342 -0
- package/agents/digital-transformation-innovation-analyst/digital-transformation-innovation-analyst_DATA_CONSTITUTION_TDD.py +615 -0
- package/agents/digital-transformation-innovation-analyst/digital-transformation-innovation-analyst_REAL_DATA_TDD.py +291 -0
- package/agents/digital-transformation-innovation-analyst/digital-transformation-innovation-analyst_data_real_sources.py +468 -0
- package/agents/digital-transformation-innovation-analyst/digital-transformation-innovation-analyst_tdd.py +1126 -0
- package/agents/digital-transformation-innovation-analyst/digital_transformation_innovation-analyst.py +756 -0
- package/agents/digital-transformation-innovation-analyst/tdd_executor.py +203 -0
- package/agents/digital-transformation-innovation-analyst/tdd_runner.py +154 -0
- package/agents/field-analysis-expert-main.md +129 -0
- package/agents/field-analysis-expert.md +231 -0
- package/agents/grounded-theory-agent-implementation.md +431 -0
- package/agents/grounded-theory-expert-v2.md +202 -0
- package/agents/grounded-theory-expert.md +309 -0
- package/agents/literature-expert-v2.md +489 -0
- package/agents/literature-expert.md +639 -0
- package/agents/literature_expert_integration.py +384 -0
- package/agents/references/actor-network-analysis.html +598 -0
- package/agents/references/ant-actor-identification.md +155 -0
- package/agents/references/ant-network-analysis.md +266 -0
- package/agents/references/ant-power-analysis.md +323 -0
- package/agents/references/ant-translation-process.md +185 -0
- package/agents/references/bourdieu-field-analysis.html +805 -0
- package/agents/references/business-ecosystem-analysis.html +598 -0
- package/agents/references/business-model-analysis-implementation-plan.md +199 -0
- package/agents/references/business-model-analysis-plan.md +217 -0
- package/agents/references/business-model-analysis.html +620 -0
- package/agents/references/business-model-coordinator.js +356 -0
- package/agents/references/business-model-expert-agent.js +204 -0
- package/agents/references/data-analysis.html +397 -0
- package/agents/references/did-analysis.html +591 -0
- package/agents/references/digital-durkheim.html +725 -0
- package/agents/references/digital-marx.html +460 -0
- package/agents/references/digital-weber.html +591 -0
- package/agents/references/field-boundary-identification.md +232 -0
- package/agents/references/field-capital-analysis.md +268 -0
- package/agents/references/grounded-theory.html +731 -0
- package/agents/references/msqca-analysis.html +589 -0
- package/agents/references/research-design.html +394 -0
- package/agents/references/social-network-analysis.html +590 -0
- package/agents/references/survey-design.html +577 -0
- package/agents/sna-expert.md +348 -0
- package/common/dependency_config.py +96 -0
- package/common/dependency_manager.py +175 -0
- package/common/smart_dependency_manager.py +331 -0
- package/package.json +81 -0
- package/scripts/postinstall.js +147 -0
- package/scripts/validate-skills.js +209 -0
- package/skills/2025_12_21_cnki-downloader.skill.install/cnki-downloader.skill +0 -0
- package/skills/2025_12_21_cnki-downloader.skill.install/cnki-downloader.skill.install.md +114 -0
- package/skills/COMPLIANCE_REPORT.md +122 -0
- package/skills/INTEGRATION_PLAN.md +405 -0
- package/skills/QWEN.md +230 -0
- package/skills/SKILLS_APPLICATION_MAPPING.md +155 -0
- package/skills/__init__.py +7 -0
- package/skills/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/SKILL.md +195 -0
- package/skills/alienation-analysis/__init__.py +8 -0
- package/skills/alienation-analysis/prompts/core-analysis-framework.md +88 -0
- package/skills/alienation-analysis/prompts/specialized-alienation-analysis.md +190 -0
- package/skills/alienation-analysis/pyproject.toml +36 -0
- package/skills/alienation-analysis/scripts/__init__.py +8 -0
- package/skills/alienation-analysis/scripts/__pycache__/alienation_analysis_engine.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/career_development_evaluation.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/classify_alienation_types.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/consumer_behavior_analysis.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/core_analyzer.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/digital_wellbeing_evaluation.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/generate_intervention_plan.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/materialism_assessment.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/relationship_quality_assessment.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/social_network_analysis.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/technology_dependency_analysis.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/__pycache__/workplace_satisfaction_analysis.cpython-312.pyc +0 -0
- package/skills/alienation-analysis/scripts/alienation_analysis_engine.py +597 -0
- package/skills/alienation-analysis/scripts/career_development_evaluation.py +512 -0
- package/skills/alienation-analysis/scripts/classify_alienation_types.py +357 -0
- package/skills/alienation-analysis/scripts/consumer_behavior_analysis.py +643 -0
- package/skills/alienation-analysis/scripts/core_analyzer.py +571 -0
- package/skills/alienation-analysis/scripts/digital_wellbeing_evaluation.py +597 -0
- package/skills/alienation-analysis/scripts/generate_intervention_plan.py +358 -0
- package/skills/alienation-analysis/scripts/materialism_assessment.py +528 -0
- package/skills/alienation-analysis/scripts/relationship_quality_assessment.py +621 -0
- package/skills/alienation-analysis/scripts/social_network_analysis.py +802 -0
- package/skills/alienation-analysis/scripts/technology_dependency_analysis.py +534 -0
- package/skills/alienation-analysis/scripts/workplace_satisfaction_analysis.py +340 -0
- package/skills/alienation_analysis/SKILL.md +291 -0
- package/skills/alienation_analysis/__init__.py +1 -0
- package/skills/alienation_analysis/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/alienation_analysis/scripts/__init__.py +1 -0
- package/skills/alienation_analysis/scripts/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/ant/SKILL.md +139 -0
- package/skills/ant/pyproject.toml +36 -0
- package/skills/ant/scripts/ant_analysis_with_fallback.py +383 -0
- package/skills/ant-expert/SKILL.md +182 -0
- package/skills/ant-expert/integration_with_trusted_scraper.md +115 -0
- package/skills/ant-expert/modules/__pycache__/network_analysis.cpython-312.pyc +0 -0
- package/skills/ant-expert/modules/__pycache__/participant_identification.cpython-312.pyc +0 -0
- package/skills/ant-expert/modules/__pycache__/translation_process.cpython-312.pyc +0 -0
- package/skills/ant-expert/modules/network_analysis.py +253 -0
- package/skills/ant-expert/modules/participant_identification.py +325 -0
- package/skills/ant-expert/modules/translation_process.py +283 -0
- package/skills/ant-expert/pyproject.toml +27 -0
- package/skills/ant-expert/scripts/ant_expert_analyzer.py +146 -0
- package/skills/ant-expert/test_input.json +82 -0
- package/skills/ant-expert/test_output.json +728 -0
- package/skills/ant-network-analysis/SKILL.md +132 -0
- package/skills/ant-participant-identification/SKILL.md +140 -0
- package/skills/ant-participant-identification/pyproject.toml +35 -0
- package/skills/ant-participant-identification/scripts/identify_participants.py +318 -0
- package/skills/ant-subagent/SKILL.md +60 -0
- package/skills/ant-subagent/modules/network_analysis.py +146 -0
- package/skills/ant-subagent/pyproject.toml +16 -0
- package/skills/ant-translation-process/SKILL.md +144 -0
- package/skills/ant-translation-process/pyproject.toml +35 -0
- package/skills/ant-translation-process/scripts/trace_translation.py +370 -0
- package/skills/ant_relationship_analysis.md +157 -0
- package/skills/arxiv-paper-search/ARXIV_SKILL_COMPLETION_REPORT.md +449 -0
- package/skills/arxiv-paper-search/DEPENDENCY_OPTIMIZATION.md +355 -0
- package/skills/arxiv-paper-search/OPTIMIZATION_SUMMARY.md +213 -0
- package/skills/arxiv-paper-search/README.md +90 -0
- package/skills/arxiv-paper-search/SKILL.md +321 -0
- package/skills/arxiv-paper-search/pyproject.toml +29 -0
- package/skills/arxiv-paper-search/references/ADVANCED_USAGE.md +587 -0
- package/skills/arxiv-paper-search/references/API_REFERENCE.md +350 -0
- package/skills/arxiv-paper-search/references/ARXIV_CATEGORIES.md +249 -0
- package/skills/arxiv-paper-search/references/USER_GUIDE.md +349 -0
- package/skills/arxiv-paper-search/requirements.txt +13 -0
- package/skills/arxiv-paper-search/scripts/__pycache__/arxiv_searcher.cpython-312.pyc +0 -0
- package/skills/arxiv-paper-search/scripts/arxiv_searcher.py +439 -0
- package/skills/arxiv-paper-search/scripts/test_arxiv_searcher.py +307 -0
- package/skills/arxiv-paper-search/test_abstracts.json +461 -0
- package/skills/arxiv-paper-search/test_batch_papers/2009.00804v2_Architectural_Implications_of_.pdf +0 -0
- package/skills/arxiv-paper-search/test_batch_papers/2201.00978v1_PyramidTNT +0 -0
- package/skills/arxiv-paper-search/test_batch_papers/2207.13219v4_Dalorex +0 -0
- package/skills/arxiv-paper-search/test_papers/1706.03762.pdf +0 -0
- package/skills/arxiv-paper-search/test_papers.csv +11 -0
- package/skills/best_practices.md +271 -0
- package/skills/business-ecosystem-analysis/integration_with_trusted_scraper.md +97 -0
- package/skills/business-ecosystem-data-collection/FreeDataCrawler.js +472 -0
- package/skills/business-ecosystem-data-collection/INFO.md +68 -0
- package/skills/business-ecosystem-data-collection/SKILL.md +118 -0
- package/skills/business-ecosystem-data-collection/algorithms/data_validation.py +44 -0
- package/skills/business-ecosystem-data-collection/algorithms/entity_recognition.py +53 -0
- package/skills/business-ecosystem-data-collection/algorithms/relationship_mapping.py +44 -0
- package/skills/business-ecosystem-data-collection/config.json +10 -0
- package/skills/business-ecosystem-data-collection/e2e-test.js +81 -0
- package/skills/business-ecosystem-data-collection/package-lock.json +433 -0
- package/skills/business-ecosystem-data-collection/package.json +21 -0
- package/skills/business-ecosystem-data-collection/references/data-collection-strategies.md +18 -0
- package/skills/business-ecosystem-data-collection/references/data-validation.md +22 -0
- package/skills/business-ecosystem-data-collection/references/entity-recognition.md +16 -0
- package/skills/business-ecosystem-data-collection/references/relationship-mapping.md +16 -0
- package/skills/business-ecosystem-data-collection/scripts/ecosystem_data_collector.py +103 -0
- package/skills/business-ecosystem-data-collection/skill.js +1383 -0
- package/skills/business-ecosystem-data-collection/skill.json +191 -0
- package/skills/business-ecosystem-data-collection/test.js +304 -0
- package/skills/business-ecosystem-data-collection/test_context.json +16 -0
- package/skills/business-model-analysis/INFO.md +65 -0
- package/skills/business-model-analysis/SKILL.md +208 -0
- package/skills/business-model-analysis/e2e-test.js +111 -0
- package/skills/business-model-analysis/integration_with_trusted_scraper.md +97 -0
- package/skills/business-model-analysis/package.json +23 -0
- package/skills/business-model-analysis/skill.js +1779 -0
- package/skills/business-model-analysis/skill.json +175 -0
- package/skills/business-model-analysis/test.js +202 -0
- package/skills/business-model-canvas-analysis/INFO.md +68 -0
- package/skills/business-model-canvas-analysis/README.md +53 -0
- package/skills/business-model-canvas-analysis/SKILL.md +215 -0
- package/skills/business-model-canvas-analysis/prompts.txt +70 -0
- package/skills/business-model-canvas-analysis/reference.md +101 -0
- package/skills/business-model-canvas-analysis/skill.js +675 -0
- package/skills/business-model-canvas-analysis/skill.json +47 -0
- package/skills/business-service-supply-analysis/INFO.md +28 -0
- package/skills/business-service-supply-analysis/SKILL.md +300 -0
- package/skills/business-service-supply-analysis/skill.js +1319 -0
- package/skills/business-service-supply-analysis/skill.json +233 -0
- package/skills/capital-analysis/INFO.md +80 -0
- package/skills/capital-analysis/README.md +65 -0
- package/skills/capital-analysis/SKILL.md +367 -0
- package/skills/capital-analysis/prompts.txt +103 -0
- package/skills/capital-analysis/reference.md +132 -0
- package/skills/capital-analysis/skill.js +739 -0
- package/skills/capital-analysis/skill.json +268 -0
- package/skills/checking-theory-saturation/SKILL.md +280 -0
- package/skills/checking-theory-saturation/pyproject.toml +17 -0
- package/skills/checking-theory-saturation/references/README.md +54 -0
- package/skills/checking-theory-saturation/scripts/__pycache__/assess_saturation.cpython-312.pyc +0 -0
- package/skills/checking-theory-saturation/scripts/assess_saturation.py +296 -0
- package/skills/checking-theory-saturation/tests/__pycache__/test_assess_saturation.cpython-312-pytest-7.4.3.pyc +0 -0
- package/skills/checking-theory-saturation/tests/test_assess_saturation.py +194 -0
- package/skills/class-structure-analysis/SKILL.md +211 -0
- package/skills/competitive-analysis/INFO.md +77 -0
- package/skills/competitive-analysis/README.md +61 -0
- package/skills/competitive-analysis/SKILL.md +357 -0
- package/skills/competitive-analysis/prompts.txt +117 -0
- package/skills/competitive-analysis/reference.md +206 -0
- package/skills/competitive-analysis/skill.js +1166 -0
- package/skills/competitive-analysis/skill.json +219 -0
- package/skills/conflict-resolution/SKILL.md +124 -0
- package/skills/conflict-resolution/conflict-resolution-skill.md +628 -0
- package/skills/data-analysis/SKILL.md +73 -0
- package/skills/data-analysis/prompts/data-cleaning-outline.md +355 -0
- package/skills/data-analysis/prompts/data-cleaning.md +40 -0
- package/skills/data-analysis/prompts/data-understanding-outline.md +243 -0
- package/skills/data-analysis/prompts/data-understanding.md +43 -0
- package/skills/data-analysis/prompts/exploratory-analysis-outline.md +316 -0
- package/skills/data-analysis/prompts/exploratory-analysis.md +40 -0
- package/skills/data-analysis/prompts/modeling-strategy.md +40 -0
- package/skills/data-analysis/pyproject.toml +39 -0
- package/skills/dependency_management.md +46 -0
- package/skills/dialectical-quantitative-synthesis/SKILL.md +239 -0
- package/skills/did-analysis/SKILL.md +239 -0
- package/skills/did-analysis/prompts/causal-interpretation.md +245 -0
- package/skills/did-analysis/prompts/experimental-design.md +260 -0
- package/skills/did-analysis/prompts/model-specification.md +242 -0
- package/skills/did-analysis/prompts/policy-recommendation.md +253 -0
- package/skills/did-analysis/pyproject.toml +35 -0
- package/skills/did-analysis/references/BEST_PRACTICES.md +553 -0
- package/skills/did-analysis/scripts/__pycache__/did_estimator.cpython-312.pyc +0 -0
- package/skills/did-analysis/scripts/__pycache__/integrated_did.cpython-312.pyc +0 -0
- package/skills/did-analysis/scripts/__pycache__/parallel_trend.cpython-312.pyc +0 -0
- package/skills/did-analysis/scripts/__pycache__/robustness_test.cpython-312.pyc +0 -0
- package/skills/did-analysis/scripts/__pycache__/visualization.cpython-312.pyc +0 -0
- package/skills/did-analysis/scripts/did_estimator.py +553 -0
- package/skills/did-analysis/scripts/integrated_did.py +867 -0
- package/skills/did-analysis/scripts/parallel_trend.py +473 -0
- package/skills/did-analysis/scripts/parallel_trend_plot.png +0 -0
- package/skills/did-analysis/scripts/parallel_trend_test.png +0 -0
- package/skills/did-analysis/scripts/placebo_test_distribution.png +0 -0
- package/skills/did-analysis/scripts/robustness_test.py +633 -0
- package/skills/did-analysis/scripts/test_integration.py +253 -0
- package/skills/did-analysis/scripts/visualization.py +539 -0
- package/skills/digital-durkheim/SKILL.md +114 -0
- package/skills/digital-durkheim/prompts/collective-consciousness.md +127 -0
- package/skills/digital-durkheim/prompts/functional-analysis.md +127 -0
- package/skills/digital-durkheim/prompts/social-fact-identification.md +128 -0
- package/skills/digital-durkheim/prompts/social-solidarity.md +134 -0
- package/skills/digital-durkheim/pyproject.toml +36 -0
- package/skills/digital-durkheim/scripts/__pycache__/integrated_durkheim_analyzer.cpython-312.pyc +0 -0
- package/skills/digital-durkheim/scripts/__pycache__/social_fact_analyzer.cpython-312.pyc +0 -0
- package/skills/digital-durkheim/scripts/durkheim_analysis_results.json +226 -0
- package/skills/digital-durkheim/scripts/integrated_durkheim_analyzer.py +540 -0
- package/skills/digital-durkheim/scripts/social_fact_analyzer.py +712 -0
- package/skills/digital-durkheim/test_integration.py +226 -0
- package/skills/digital-marx/README.md +215 -0
- package/skills/digital-marx/SHORT_TERM_IMPLEMENTATION_REPORT.md +183 -0
- package/skills/digital-marx/SKILL.md +189 -0
- package/skills/digital-marx/THEORETICAL_ACCURACY_ANALYSIS.md +278 -0
- package/skills/digital-marx/prompts/material-base-analysis.md +113 -0
- package/skills/digital-marx/prompts/production-relations-analysis.md +113 -0
- package/skills/digital-marx/prompts/social-change-prediction.md +112 -0
- package/skills/digital-marx/prompts/superstructure-analysis.md +112 -0
- package/skills/digital-marx/pyproject.toml +37 -0
- package/skills/digital-marx/scripts/__pycache__/dialectical_thinking_analyzer.cpython-312.pyc +0 -0
- package/skills/digital-marx/scripts/__pycache__/enhanced_historical_materialism_analyzer.cpython-312.pyc +0 -0
- package/skills/digital-marx/scripts/__pycache__/historical_materialism_analyzer.cpython-312.pyc +0 -0
- package/skills/digital-marx/scripts/basic_quality_detector.py +760 -0
- package/skills/digital-marx/scripts/dialectical_thinking_analyzer.py +1601 -0
- package/skills/digital-marx/scripts/enhanced_historical_materialism_analyzer.py +1525 -0
- package/skills/digital-marx/scripts/historical_materialism_analyzer.py +963 -0
- package/skills/digital-marx/scripts/integrated_marx_analyzer.py +932 -0
- package/skills/digital-marx/scripts/marxist_theory_validator.py +1192 -0
- package/skills/digital-marx/scripts/quality_validator.py +890 -0
- package/skills/digital-marx-expert/SKILL.md +179 -0
- package/skills/digital-marx-expert/modules/__pycache__/capital_analysis.cpython-312.pyc +0 -0
- package/skills/digital-marx-expert/modules/__pycache__/class_analysis.cpython-312.pyc +0 -0
- package/skills/digital-marx-expert/modules/__pycache__/historical_materialism.cpython-312.pyc +0 -0
- package/skills/digital-marx-expert/modules/capital_analysis.py +611 -0
- package/skills/digital-marx-expert/modules/class_analysis.py +836 -0
- package/skills/digital-marx-expert/modules/historical_materialism.py +435 -0
- package/skills/digital-marx-expert/pyproject.toml +29 -0
- package/skills/digital-marx-expert/scripts/digital_marx_expert_analyzer.py +189 -0
- package/skills/digital-marx-expert/test_input.json +100 -0
- package/skills/digital-marx-expert/test_output.json +588 -0
- package/skills/digital-transformation/business-innovation-pathway-planning.SKILL.md +102 -0
- package/skills/digital-transformation/business-model-reconstruction.SKILL.md +88 -0
- package/skills/digital-transformation/business-scene-deconstruction-analysis.SKILL.md +131 -0
- package/skills/digital-transformation/config.json +16 -0
- package/skills/digital-transformation/config_host_llm.json +311 -0
- package/skills/digital-transformation/config_llm.json +297 -0
- package/skills/digital-transformation/digitization-deconstruction-analysis.SKILL.md +84 -0
- package/skills/digital-transformation/innovation-niche-identification.SKILL.md +78 -0
- package/skills/digital-transformation/intelligent-transformation-deconstruction-analysis.SKILL.md +110 -0
- package/skills/digital-transformation/online-transformation-deconstruction-analysis.SKILL.md +110 -0
- package/skills/digital-transformation/scripts/data_integrator.py +637 -0
- package/skills/digital-transformation/scripts/digital_transformation_analyzer.py +800 -0
- package/skills/digital-transformation/scripts/digital_transformation_analyzer_agentskills_io.py +1677 -0
- package/skills/digital-transformation/scripts/digital_transformation_analyzer_host_cli.py +834 -0
- package/skills/digital-transformation/scripts/digital_transformation_analyzer_host_llm.py +1026 -0
- package/skills/digital-transformation/scripts/digital_transformation_analyzer_llm.py +957 -0
- package/skills/digital-transformation/scripts/host_cli_interface.py +531 -0
- package/skills/digital-transformation/scripts/llm_client.py +662 -0
- package/skills/digital-transformation/scripts/skill_executor.py +527 -0
- package/skills/digital-transformation/scripts/transformation_visualizer.py +946 -0
- package/skills/digital-transformation/test_context.json +6 -0
- package/skills/digital-transformation/tests/test_digital_transformation.py +844 -0
- package/skills/digital-weber/SKILL.md +88 -0
- package/skills/digital-weber/prompts/comparative-research.md +155 -0
- package/skills/digital-weber/prompts/institutional-analysis.md +147 -0
- package/skills/digital-weber/prompts/theoretical-interpretation.md +102 -0
- package/skills/digital-weber/prompts/understanding-analysis.md +129 -0
- package/skills/digital-weber/pyproject.toml +36 -0
- package/skills/digital-weber/scripts/__pycache__/integrated_weber_analyzer.cpython-312.pyc +0 -0
- package/skills/digital-weber/scripts/__pycache__/optimized_weberian_analyzer.cpython-312.pyc +0 -0
- package/skills/digital-weber/scripts/__pycache__/weberian_analyzer.cpython-312.pyc +0 -0
- package/skills/digital-weber/scripts/enhanced_weberian_analyzer.py +531 -0
- package/skills/digital-weber/scripts/integrated_weber_analyzer.py +772 -0
- package/skills/digital-weber/scripts/optimized_weberian_analyzer.py +713 -0
- package/skills/digital-weber/scripts/weber_analysis_results.json +196 -0
- package/skills/digital-weber/scripts/weberian_analyzer.py +877 -0
- package/skills/digital-weber/simple_quality_test.py +204 -0
- package/skills/digital-weber/test_comprehensive.py +320 -0
- package/skills/digital-weber/test_quality_improvement.py +237 -0
- package/skills/dissent-resolution/SKILL.md +159 -0
- package/skills/ecosystem-analysis/analyzing-business-model-of-key-species.SKILL.md +31 -0
- package/skills/ecosystem-analysis/analyzing-digital-transformation-impact-on-business.SKILL.md +36 -0
- package/skills/ecosystem-analysis/assessing-ecosystem-impact-of-digital-transformation.SKILL.md +36 -0
- package/skills/ecosystem-analysis/config.json +15 -0
- package/skills/ecosystem-analysis/constructing-business-ecosystem-map.SKILL.md +31 -0
- package/skills/ecosystem-analysis/identifying-key-species-in-industry.SKILL.md +30 -0
- package/skills/ecosystem-analysis/performing-industry-ecosystem-analysis.SKILL.md +79 -0
- package/skills/ecosystem-analysis/references/industry-life-cycle.md +29 -0
- package/skills/ecosystem-analysis/references/value-chain-analysis.md +28 -0
- package/skills/ecosystem-analysis/scripts/business_ecosystem_analyzer.py +640 -0
- package/skills/ecosystem-analysis/scripts/data_collector.py +239 -0
- package/skills/ecosystem-analysis/scripts/ecosystem_analysis.py +309 -0
- package/skills/ecosystem-analysis/scripts/ecosystem_data_integrator.py +620 -0
- package/skills/ecosystem-analysis/scripts/ecosystem_preprocessing.py +262 -0
- package/skills/ecosystem-analysis/scripts/ecosystem_visualizer.py +811 -0
- package/skills/ecosystem-analysis/test_context.json +6 -0
- package/skills/ecosystem-analysis/tests/test_ecosystem_analysis.py +1193 -0
- package/skills/ecosystem-relationship-analysis/INFO.md +28 -0
- package/skills/ecosystem-relationship-analysis/SKILL.md +147 -0
- package/skills/ecosystem-relationship-analysis/algorithms/community_detection.py +128 -0
- package/skills/ecosystem-relationship-analysis/algorithms/health_assessment.py +53 -0
- package/skills/ecosystem-relationship-analysis/algorithms/network_analysis.py +171 -0
- package/skills/ecosystem-relationship-analysis/config.json +10 -0
- package/skills/ecosystem-relationship-analysis/references/community-detection.md +24 -0
- package/skills/ecosystem-relationship-analysis/references/ecosystem-theory.md +23 -0
- package/skills/ecosystem-relationship-analysis/references/health-assessment.md +23 -0
- package/skills/ecosystem-relationship-analysis/references/network-analysis-theory.md +19 -0
- package/skills/ecosystem-relationship-analysis/references/relationship-analysis.md +27 -0
- package/skills/ecosystem-relationship-analysis/scripts/ecosystem_relationship_analyzer.py +155 -0
- package/skills/ecosystem-relationship-analysis/skill.js +797 -0
- package/skills/ecosystem-relationship-analysis/skill.json +205 -0
- package/skills/field-analysis/SKILL.md +145 -0
- package/skills/field-boundary-identification/SKILL.md +156 -0
- package/skills/field-boundary-identification/pyproject.toml +36 -0
- package/skills/field-boundary-identification/scripts/identify_boundaries.py +326 -0
- package/skills/field-capital-analysis/SKILL.md +165 -0
- package/skills/field-expert/SKILL.md +409 -0
- package/skills/field-expert/WORKFLOW_SPEC.md +195 -0
- package/skills/field-expert/field_analysis_workflow/input/processed/combined_input.json +247 -0
- package/skills/field-expert/field_analysis_workflow/input/processed/llm_input.json +76 -0
- package/skills/field-expert/field_analysis_workflow/intermediate/01_boundary/boundary_results.json +6 -0
- package/skills/field-expert/field_analysis_workflow/intermediate/02_capital/capital_results.json +5 -0
- package/skills/field-expert/field_analysis_workflow/intermediate/03_habitus/habitus_results.json +120 -0
- package/skills/field-expert/field_analysis_workflow/intermediate/04_dynamics/dynamics_results.json +6 -0
- package/skills/field-expert/field_analysis_workflow/output/executive_summary.txt +35 -0
- package/skills/field-expert/field_analysis_workflow/output/json/comprehensive_analysis.json +180 -0
- package/skills/field-expert/field_analysis_workflow/output/reports/field_analysis_report.html +22 -0
- package/skills/field-expert/modules/__pycache__/boundary_analysis.cpython-312.pyc +0 -0
- package/skills/field-expert/modules/__pycache__/capital_analysis.cpython-312.pyc +0 -0
- package/skills/field-expert/modules/__pycache__/habitus_analysis.cpython-312.pyc +0 -0
- package/skills/field-expert/modules/boundary_analysis.py +234 -0
- package/skills/field-expert/modules/capital_analysis.py +407 -0
- package/skills/field-expert/modules/habitus_analysis.py +306 -0
- package/skills/field-expert/prompts/boundary_analysis.txt +56 -0
- package/skills/field-expert/prompts/boundary_analysis_simple.txt +17 -0
- package/skills/field-expert/prompts/capital_analysis.txt +87 -0
- package/skills/field-expert/prompts/dynamics_analysis.txt +89 -0
- package/skills/field-expert/prompts/habitus_analysis.txt +87 -0
- package/skills/field-expert/pyproject.toml +27 -0
- package/skills/field-expert/scripts/__pycache__/field_analysis_tool.cpython-312.pyc +0 -0
- package/skills/field-expert/scripts/__pycache__/prepare_data.cpython-312.pyc +0 -0
- package/skills/field-expert/scripts/debug_output.txt +4 -0
- package/skills/field-expert/scripts/debug_output_converted.txt +27 -0
- package/skills/field-expert/scripts/field_analysis_tool.py +536 -0
- package/skills/field-expert/scripts/field_expert_analyzer.py +136 -0
- package/skills/field-expert/scripts/generate_report.py +525 -0
- package/skills/field-expert/scripts/prepare_data.py +226 -0
- package/skills/field-expert/scripts/run_workflow.py +571 -0
- package/skills/field-expert/scripts/summarize_data.py +156 -0
- package/skills/field-expert/scripts/temp_prompt_20260106_213035_964505.txt +135 -0
- package/skills/field-expert/scripts/temp_prompt_20260106_213534_264265.txt +16 -0
- package/skills/field-expert/scripts/temp_prompt_20260106_213932_601575.txt +22 -0
- package/skills/field-expert/scripts/temp_prompt_20260106_214330_241706.txt +15 -0
- package/skills/field-expert/scripts/test_host_llm.py +164 -0
- package/skills/field-expert/scripts/test_stigmergy_llm.py +91 -0
- package/skills/field-expert/test_input.json +168 -0
- package/skills/field-expert/test_output.json +724 -0
- package/skills/field-expert/workflow_spec.json +171 -0
- package/skills/field-habitus-analysis/SKILL.md +165 -0
- package/skills/fsqca-analysis/SKILL.md +71 -0
- package/skills/fsqca-analysis/assets/templates/report_template.md +122 -0
- package/skills/fsqca-analysis/comprehensive_test.py +573 -0
- package/skills/fsqca-analysis/comprehensive_test_report.json +207 -0
- package/skills/fsqca-analysis/comprehensive_test_report.md +35 -0
- package/skills/fsqca-analysis/fsqca_analysis_report.md +35 -0
- package/skills/fsqca-analysis/prompts/calibration-guidance-outline.md +142 -0
- package/skills/fsqca-analysis/prompts/calibration-guidance.md +40 -0
- package/skills/fsqca-analysis/prompts/result-interpretation-outline.md +133 -0
- package/skills/fsqca-analysis/prompts/result-interpretation.md +45 -0
- package/skills/fsqca-analysis/prompts/theoretical-analysis-outline.md +75 -0
- package/skills/fsqca-analysis/prompts/theoretical-analysis.md +34 -0
- package/skills/fsqca-analysis/pyproject.toml +36 -0
- package/skills/fsqca-analysis/references/BEST_PRACTICES-outline.md +158 -0
- package/skills/fsqca-analysis/references/BEST_PRACTICES.md +39 -0
- package/skills/fsqca-analysis/references/METHODOLOGY-outline.md +103 -0
- package/skills/fsqca-analysis/references/METHODOLOGY.md +38 -0
- package/skills/fsqca-analysis/scripts/__pycache__/calibration.cpython-312.pyc +0 -0
- package/skills/fsqca-analysis/scripts/__pycache__/integrated_analysis.cpython-312.pyc +0 -0
- package/skills/fsqca-analysis/scripts/__pycache__/minimization.cpython-312.pyc +0 -0
- package/skills/fsqca-analysis/scripts/__pycache__/truth_table.cpython-312.pyc +0 -0
- package/skills/fsqca-analysis/scripts/calibration.py +540 -0
- package/skills/fsqca-analysis/scripts/integrated_analysis.py +651 -0
- package/skills/fsqca-analysis/scripts/minimization.py +536 -0
- package/skills/fsqca-analysis/scripts/truth_table.py +433 -0
- package/skills/fsqca-analysis/test_fsqca.py +199 -0
- package/skills/fusion_plan.md +232 -0
- package/skills/grounded-theory-expert/SKILL.md +180 -0
- package/skills/grounded-theory-expert/pyproject.toml +23 -0
- package/skills/grounded-theory-expert/scripts/gt_expert_analyzer.py +185 -0
- package/skills/grounded-theory-expert/stages/__pycache__/axial_coding.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert/stages/__pycache__/open_coding.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert/stages/__pycache__/selective_coding.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert/stages/axial_coding.py +294 -0
- package/skills/grounded-theory-expert/stages/open_coding.py +245 -0
- package/skills/grounded-theory-expert/stages/selective_coding.py +410 -0
- package/skills/grounded-theory-expert/test_input.json +27 -0
- package/skills/grounded-theory-expert/test_output.json +874 -0
- package/skills/grounded-theory-expert/tests/sample-cases/hongloumeng.txt +91 -0
- package/skills/grounded-theory-expert/tests/sample-cases/sanguoyanyi_excerpts.txt +169 -0
- package/skills/grounded-theory-expert/tests/sample-cases/shuihuzhuan_excerpts.txt +216 -0
- package/skills/grounded-theory-expert/tests/sample-cases/xiyouji_excerpts.txt +100 -0
- package/skills/grounded-theory-expert/tests/sample-cases//345/233/233/345/244/247/345/220/215/350/221/227ANT/345/210/206/346/236/220/346/212/245/345/221/212.md +283 -0
- package/skills/grounded-theory-expert/tools/__pycache__/memo_writer.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert/tools/__pycache__/saturation_checker.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert/tools/memo_writer.py +512 -0
- package/skills/grounded-theory-expert/tools/saturation_checker.py +345 -0
- package/skills/grounded-theory-expert-enhanced/SKILL.md +218 -0
- package/skills/grounded-theory-expert-enhanced/docs/00_master_guide.md +276 -0
- package/skills/grounded-theory-expert-enhanced/docs/01_quick_start.md +59 -0
- package/skills/grounded-theory-expert-enhanced/docs/02_task_flow.md +464 -0
- package/skills/grounded-theory-expert-enhanced/docs/03_path/350/247/204/350/214/203.md +161 -0
- package/skills/grounded-theory-expert-enhanced/docs/04_html_report.md +340 -0
- package/skills/grounded-theory-expert-enhanced/docs/05_best_practices.md +322 -0
- package/skills/grounded-theory-expert-enhanced/docs/FLOW_GUIDE.md +280 -0
- package/skills/grounded-theory-expert-enhanced/docs/LLM/350/260/203/347/224/250/346/250/241/346/213/237/346/265/201/347/250/213.md +299 -0
- package/skills/grounded-theory-expert-enhanced/docs/experts/constructivist_expert.md +64 -0
- package/skills/grounded-theory-expert-enhanced/docs/experts/localization_expert.md +66 -0
- package/skills/grounded-theory-expert-enhanced/docs/experts/phenomenological_expert.md +64 -0
- package/skills/grounded-theory-expert-enhanced/docs/experts/positivist_expert.md +67 -0
- package/skills/grounded-theory-expert-enhanced/docs/prompts/level1_prompts.md +174 -0
- package/skills/grounded-theory-expert-enhanced/docs/prompts/level2_prompts.md +176 -0
- package/skills/grounded-theory-expert-enhanced/docs/prompts/level3_prompts.md +219 -0
- package/skills/grounded-theory-expert-enhanced/docs/prompts/preprocessing_prompts.md +120 -0
- package/skills/grounded-theory-expert-enhanced/docs/references/quality_standards.md +166 -0
- package/skills/grounded-theory-expert-enhanced/docs/references/reliability_methods.md +159 -0
- package/skills/grounded-theory-expert-enhanced/docs/references/saturation_methods.md +193 -0
- package/skills/grounded-theory-expert-enhanced/docs/references/theory_construction.md +166 -0
- package/skills/grounded-theory-expert-enhanced/pyproject.toml +33 -0
- package/skills/grounded-theory-expert-enhanced/references/llm_integration_principles.md +56 -0
- package/skills/grounded-theory-expert-enhanced/scripts/preprocessing_script.py +191 -0
- package/skills/grounded-theory-expert-enhanced/stages/enhanced_axial_coding.py +146 -0
- package/skills/grounded-theory-expert-enhanced/stages/enhanced_open_coding.py +94 -0
- package/skills/grounded-theory-expert-enhanced/stages/enhanced_selective_coding.py +163 -0
- package/skills/grounded-theory-expert-enhanced/tools/.env.example +34 -0
- package/skills/grounded-theory-expert-enhanced/tools/LLM_CONFIG_GUIDE.md +67 -0
- package/skills/grounded-theory-expert-enhanced/tools/__pycache__/analysis_controller.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert-enhanced/tools/__pycache__/host_cli_coder.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert-enhanced/tools/__pycache__/llm_expert_coder.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert-enhanced/tools/__pycache__/project_structure.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert-enhanced/tools/__pycache__/reliability_validator.cpython-312.pyc +0 -0
- package/skills/grounded-theory-expert-enhanced/tools/analysis_controller.py +2344 -0
- package/skills/grounded-theory-expert-enhanced/tools/enhanced_memo_writer.py +90 -0
- package/skills/grounded-theory-expert-enhanced/tools/enhanced_saturation_checker.py +216 -0
- package/skills/grounded-theory-expert-enhanced/tools/fix_dirs.py +48 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/00_raw_data/source_document.txt +91 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/01_preprocessing/preprocessing_report.json +15 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/01_preprocessing/text_cleaned/cleaned_text.txt +198 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/01_preprocessing/text_tokenized/tokenized_text.json +1099 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/02_segmentation/segment_10_1%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/02_segmentation/segment_10_1%/segment_text.txt +20 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/02_segmentation/segment_10_2%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/02_segmentation/segment_10_2%/segment_text.txt +21 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/02_segmentation/segment_10_3%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/02_segmentation/segment_10_3%/segment_text.txt +23 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/02_segmentation/segment_70%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/02_segmentation/segment_70%/segment_text.txt +135 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/02_segmentation/segmentation_summary.json +34 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_constructivist/initial_concepts.json +242 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_constructivist/open_coding_results.json +250 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_constructivist/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_localization/initial_concepts.json +242 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_localization/open_coding_results.json +250 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_localization/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_phenomenological/initial_concepts.json +242 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_phenomenological/open_coding_results.json +250 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_phenomenological/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_positivist/initial_concepts.json +242 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_positivist/open_coding_results.json +250 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/expert_positivist/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/03_level1_coding/level1_all_experts_summary.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/04_level1_consensus/consensus_achievement/consensus_report.json +13 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/04_level1_consensus/consensus_achievement/merged_concept_library.json +308 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/04_level1_consensus/consensus_calculation/cohens_kappa.json +10 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/04_level1_consensus/consensus_calculation/fleiss_kappa.json +5 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/04_level1_consensus/consensus_calculation/krippendorff_alpha.json +5 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/05_level2_coding/expert_constructivist/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/05_level2_coding/expert_localization/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/05_level2_coding/expert_phenomenological/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/05_level2_coding/expert_positivist/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/05_level2_coding/level2_all_experts_summary.json +31 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/06_level2_consensus/divergence_resolution/divergence_report.json +10 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/06_level2_consensus/divergence_resolution/merged_category_library.json +7 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/06_level2_consensus/divergence_resolution/paradigm_model.json +9 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/07_level3_coding/expert_constructivist/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/07_level3_coding/expert_localization/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/07_level3_coding/expert_phenomenological/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/07_level3_coding/expert_positivist/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/07_level3_coding/level3_all_experts_summary.json +30 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/08_level3_consensus/consensus_calculation/core_category_comparison.json +40 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/08_level3_consensus/theoretical_integration/final_theoretical_integration.json +52 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/08_level3_consensus/theoretical_integration/theory_description.md +40 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/09_saturation_test/final_saturation_verdict.json +32 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/09_saturation_test/iteration_100/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/09_saturation_test/iteration_70/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/09_saturation_test/iteration_80/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/09_saturation_test/iteration_90/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/10_final_report/codebook.md +84 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/10_final_report/comprehensive_analysis_report.md +360 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/10_final_report/project_summary.json +214 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/10_final_report/theory_description.md +91 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/config.json +68 -0
- package/skills/grounded-theory-expert-enhanced/tools/hongloumeng_project/project_manifest.json +9 -0
- package/skills/grounded-theory-expert-enhanced/tools/host_cli_coder.py +168 -0
- package/skills/grounded-theory-expert-enhanced/tools/llm_expert_coder.py +469 -0
- package/skills/grounded-theory-expert-enhanced/tools/project_structure.py +1202 -0
- package/skills/grounded-theory-expert-enhanced/tools/reliability_validator.py +800 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/00_raw_data/source_document.txt +169 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/01_preprocessing/preprocessing_report.json +15 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/01_preprocessing/text_cleaned/cleaned_text.txt +200 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/01_preprocessing/text_tokenized/tokenized_text.json +1109 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/02_segmentation/segment_10_1%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/02_segmentation/segment_10_1%/segment_text.txt +22 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/02_segmentation/segment_10_2%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/02_segmentation/segment_10_2%/segment_text.txt +18 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/02_segmentation/segment_10_3%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/02_segmentation/segment_10_3%/segment_text.txt +24 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/02_segmentation/segment_70%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/02_segmentation/segment_70%/segment_text.txt +134 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/02_segmentation/segmentation_summary.json +34 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_constructivist/initial_concepts.json +242 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_constructivist/open_coding_results.json +250 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_constructivist/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_localization/initial_concepts.json +242 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_localization/open_coding_results.json +250 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_localization/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_phenomenological/initial_concepts.json +242 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_phenomenological/open_coding_results.json +250 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_phenomenological/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_positivist/initial_concepts.json +242 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_positivist/open_coding_results.json +250 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/expert_positivist/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/03_level1_coding/level1_all_experts_summary.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/04_level1_consensus/consensus_achievement/consensus_report.json +13 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/04_level1_consensus/consensus_achievement/merged_concept_library.json +308 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/04_level1_consensus/consensus_calculation/cohens_kappa.json +10 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/04_level1_consensus/consensus_calculation/fleiss_kappa.json +5 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/04_level1_consensus/consensus_calculation/krippendorff_alpha.json +5 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/05_level2_coding/expert_constructivist/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/05_level2_coding/expert_localization/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/05_level2_coding/expert_phenomenological/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/05_level2_coding/expert_positivist/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/05_level2_coding/level2_all_experts_summary.json +31 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/06_level2_consensus/divergence_resolution/divergence_report.json +10 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/06_level2_consensus/divergence_resolution/merged_category_library.json +7 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/06_level2_consensus/divergence_resolution/paradigm_model.json +9 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/07_level3_coding/expert_constructivist/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/07_level3_coding/expert_localization/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/07_level3_coding/expert_phenomenological/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/07_level3_coding/expert_positivist/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/07_level3_coding/level3_all_experts_summary.json +30 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/08_level3_consensus/consensus_calculation/core_category_comparison.json +40 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/08_level3_consensus/theoretical_integration/final_theoretical_integration.json +52 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/08_level3_consensus/theoretical_integration/theory_description.md +40 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/09_saturation_test/final_saturation_verdict.json +32 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/09_saturation_test/iteration_100/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/09_saturation_test/iteration_70/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/09_saturation_test/iteration_80/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/09_saturation_test/iteration_90/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/10_final_report/codebook.md +84 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/10_final_report/comprehensive_analysis_report.md +360 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/10_final_report/project_summary.json +214 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/10_final_report/theory_description.md +91 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/config.json +68 -0
- package/skills/grounded-theory-expert-enhanced/tools/sanguoyanyi_project/project_manifest.json +9 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_claude.py +40 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_host_cli_coder.py +168 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/00_raw_data/source_document.txt +11 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/01_preprocessing/preprocessing_report.json +15 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/01_preprocessing/text_cleaned/cleaned_text.txt +16 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/01_preprocessing/text_tokenized/tokenized_text.json +129 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/02_segmentation/segment_10_1%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/02_segmentation/segment_10_1%/segment_text.txt +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/02_segmentation/segment_10_2%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/02_segmentation/segment_10_2%/segment_text.txt +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/02_segmentation/segment_10_3%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/02_segmentation/segment_10_3%/segment_text.txt +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/02_segmentation/segment_70%/segment_info.json +8 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/02_segmentation/segment_70%/segment_text.txt +11 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/02_segmentation/segmentation_summary.json +34 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_constructivist/initial_concepts.json +218 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_constructivist/open_coding_results.json +226 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_constructivist/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_localization/initial_concepts.json +218 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_localization/open_coding_results.json +226 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_localization/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_phenomenological/initial_concepts.json +218 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_phenomenological/open_coding_results.json +226 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_phenomenological/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_positivist/initial_concepts.json +218 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_positivist/open_coding_results.json +226 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/expert_positivist/raw_quotes.json +1 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/03_level1_coding/level1_all_experts_summary.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/04_level1_consensus/consensus_achievement/consensus_report.json +13 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/04_level1_consensus/consensus_achievement/merged_concept_library.json +278 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/04_level1_consensus/consensus_calculation/cohens_kappa.json +10 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/04_level1_consensus/consensus_calculation/fleiss_kappa.json +5 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/04_level1_consensus/consensus_calculation/krippendorff_alpha.json +5 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/05_level2_coding/expert_constructivist/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/05_level2_coding/expert_localization/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/05_level2_coding/expert_phenomenological/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/05_level2_coding/expert_positivist/axial_coding_results.json +14 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/05_level2_coding/level2_all_experts_summary.json +31 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/06_level2_consensus/divergence_resolution/divergence_report.json +10 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/06_level2_consensus/divergence_resolution/merged_category_library.json +7 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/06_level2_consensus/divergence_resolution/paradigm_model.json +9 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/07_level3_coding/expert_constructivist/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/07_level3_coding/expert_localization/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/07_level3_coding/expert_phenomenological/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/07_level3_coding/expert_positivist/selective_coding_results.json +28 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/07_level3_coding/level3_all_experts_summary.json +30 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/08_level3_consensus/consensus_calculation/core_category_comparison.json +40 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/08_level3_consensus/theoretical_integration/final_theoretical_integration.json +52 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/08_level3_consensus/theoretical_integration/theory_description.md +40 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/09_saturation_test/final_saturation_verdict.json +32 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/09_saturation_test/iteration_100/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/09_saturation_test/iteration_70/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/09_saturation_test/iteration_80/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/09_saturation_test/iteration_90/saturation_indicators.json +6 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/10_final_report/codebook.md +84 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/10_final_report/comprehensive_analysis_report.md +360 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/10_final_report/project_summary.json +214 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/10_final_report/theory_description.md +91 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/config.json +68 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_project_3/project_manifest.json +9 -0
- package/skills/grounded-theory-expert-enhanced/tools/test_real_coding.py +135 -0
- package/skills/historical-materialist-analysis/SKILL.md +186 -0
- package/skills/information-verification/INFO.md +69 -0
- package/skills/information-verification/README.md +80 -0
- package/skills/information-verification/SKILL.md +305 -0
- package/skills/information-verification/prompts.txt +103 -0
- package/skills/information-verification/reference.md +212 -0
- package/skills/information-verification/skill.js +1056 -0
- package/skills/information-verification/skill.json +198 -0
- package/skills/management-theory-analysis/INFO.md +74 -0
- package/skills/management-theory-analysis/README.md +63 -0
- package/skills/management-theory-analysis/SKILL.md +361 -0
- package/skills/management-theory-analysis/prompts.txt +113 -0
- package/skills/management-theory-analysis/reference.md +167 -0
- package/skills/management-theory-analysis/skill.js +561 -0
- package/skills/management-theory-analysis/skill.json +223 -0
- package/skills/mathematical-statistics/SKILL.md +227 -0
- package/skills/mathematical-statistics/pyproject.toml +36 -0
- package/skills/mathematical-statistics/scripts/statistics_toolkit.py +270 -0
- package/skills/msqca-analysis/SKILL.md +261 -0
- package/skills/msqca-analysis/assets/templates/data_template.csv +11 -0
- package/skills/msqca-analysis/assets/templates/report_template.md +188 -0
- package/skills/msqca-analysis/integrated_analysis_report.md +35 -0
- package/skills/msqca-analysis/prompts/calibration-guidance.md +251 -0
- package/skills/msqca-analysis/prompts/result-interpretation.md +253 -0
- package/skills/msqca-analysis/prompts/theoretical-analysis.md +172 -0
- package/skills/msqca-analysis/pyproject.toml +37 -0
- package/skills/msqca-analysis/references/BEST_PRACTICES.md +612 -0
- package/skills/msqca-analysis/references/METHODOLOGY.md +282 -0
- package/skills/msqca-analysis/scripts/__pycache__/calibration.cpython-312.pyc +0 -0
- package/skills/msqca-analysis/scripts/__pycache__/integrated_analysis.cpython-312.pyc +0 -0
- package/skills/msqca-analysis/scripts/__pycache__/minimization.cpython-312.pyc +0 -0
- package/skills/msqca-analysis/scripts/__pycache__/truth_table.cpython-312.pyc +0 -0
- package/skills/msqca-analysis/scripts/calibration.py +341 -0
- package/skills/msqca-analysis/scripts/integrated_analysis.py +621 -0
- package/skills/msqca-analysis/scripts/integrated_analysis_report.md +35 -0
- package/skills/msqca-analysis/scripts/minimization.py +580 -0
- package/skills/msqca-analysis/scripts/truth_table.py +438 -0
- package/skills/network-computation/SKILL.md +270 -0
- package/skills/network-computation/pyproject.toml +34 -0
- package/skills/network-computation/scripts/calculate_centrality.py +213 -0
- package/skills/network-computation-expert/SKILL.md +183 -0
- package/skills/network-computation-expert/modules/__pycache__/centrality_analysis.cpython-312.pyc +0 -0
- package/skills/network-computation-expert/modules/__pycache__/community_detection.cpython-312.pyc +0 -0
- package/skills/network-computation-expert/modules/__pycache__/data_processing.cpython-312.pyc +0 -0
- package/skills/network-computation-expert/modules/__pycache__/network_construction.cpython-312.pyc +0 -0
- package/skills/network-computation-expert/modules/centrality_analysis.py +438 -0
- package/skills/network-computation-expert/modules/community_detection.py +467 -0
- package/skills/network-computation-expert/modules/data_processing.py +467 -0
- package/skills/network-computation-expert/modules/network_construction.py +460 -0
- package/skills/network-computation-expert/pyproject.toml +27 -0
- package/skills/network-computation-expert/scripts/network_computation_expert_analyzer.py +208 -0
- package/skills/network-computation-expert/test_input.json +140 -0
- package/skills/network-computation-expert/test_output.json +627 -0
- package/skills/operations-analysis/INFO.md +76 -0
- package/skills/operations-analysis/README.md +61 -0
- package/skills/operations-analysis/SKILL.md +365 -0
- package/skills/operations-analysis/prompts.txt +109 -0
- package/skills/operations-analysis/pyproject.toml +35 -0
- package/skills/operations-analysis/reference.md +178 -0
- package/skills/operations-analysis/skill.js +870 -0
- package/skills/operations-analysis/skill.json +219 -0
- package/skills/patent-downloader/README.md +358 -0
- package/skills/patent-downloader/SKILL.md +309 -0
- package/skills/patent-downloader/assets/README_TEMPLATE.md +140 -0
- package/skills/patent-downloader/assets/requirements.txt +5 -0
- package/skills/patent-downloader/references/google_patents.md +210 -0
- package/skills/patent-downloader/scripts/patent_server.py +279 -0
- package/skills/performing-axial-coding/SKILL.md +301 -0
- package/skills/performing-axial-coding/pyproject.toml +30 -0
- package/skills/performing-axial-coding/references/README.md +111 -0
- package/skills/performing-axial-coding/references/_BACKUP_paradigm-theory.md +375 -0
- package/skills/performing-axial-coding/references/_BACKUP_relationship-types.md +544 -0
- package/skills/performing-axial-coding/references/_BACKUP_troubleshooting.md +627 -0
- package/skills/performing-axial-coding/references/category-construction/INDEX.md +190 -0
- package/skills/performing-axial-coding/references/category-construction/complete-example.md +438 -0
- package/skills/performing-axial-coding/references/paradigm-theory/INDEX.md +181 -0
- package/skills/performing-axial-coding/references/paradigm-theory/chinese-adaptation.md +349 -0
- package/skills/performing-axial-coding/references/paradigm-theory/quality-standards.md +345 -0
- package/skills/performing-axial-coding/references/paradigm-theory/six-components.md +323 -0
- package/skills/performing-axial-coding/references/relationship-types/INDEX.md +126 -0
- package/skills/performing-axial-coding/references/relationship-types/causal.md +141 -0
- package/skills/performing-axial-coding/references/relationship-types/conditional.md +150 -0
- package/skills/performing-axial-coding/references/troubleshooting/INDEX.md +136 -0
- package/skills/performing-axial-coding/references/troubleshooting/category-issues.md +129 -0
- package/skills/performing-axial-coding/references/troubleshooting/relationship-issues.md +137 -0
- package/skills/performing-axial-coding/references/troubleshooting/technical-issues.md +184 -0
- package/skills/performing-axial-coding/scripts/__pycache__/build_relationships.cpython-312.pyc +0 -0
- package/skills/performing-axial-coding/scripts/__pycache__/construct_paradigm.cpython-312.pyc +0 -0
- package/skills/performing-axial-coding/scripts/__pycache__/identify_categories.cpython-312.pyc +0 -0
- package/skills/performing-axial-coding/scripts/build_relationships.py +314 -0
- package/skills/performing-axial-coding/scripts/categories_test.json +122 -0
- package/skills/performing-axial-coding/scripts/construct_paradigm.py +271 -0
- package/skills/performing-axial-coding/scripts/identify_categories.py +267 -0
- package/skills/performing-axial-coding/tests/test_integration.py +84 -0
- package/skills/performing-centrality-analysis/SKILL.md +210 -0
- package/skills/performing-centrality-analysis/pyproject.toml +21 -0
- package/skills/performing-centrality-analysis/references/README.md +60 -0
- package/skills/performing-centrality-analysis/references/centrality-theory/INDEX.md +136 -0
- package/skills/performing-centrality-analysis/references/chinese-context/INDEX.md +169 -0
- package/skills/performing-centrality-analysis/scripts/__pycache__/calculate_centrality.cpython-312.pyc +0 -0
- package/skills/performing-centrality-analysis/scripts/calculate_centrality.py +213 -0
- package/skills/performing-centrality-analysis/tests/__pycache__/test_calculate_centrality.cpython-312-pytest-7.4.3.pyc +0 -0
- package/skills/performing-centrality-analysis/tests/test_calculate_centrality.py +218 -0
- package/skills/performing-network-computation/SKILL.md +224 -0
- package/skills/performing-network-computation/pyproject.toml +34 -0
- package/skills/performing-network-computation/scripts/build_network.py +260 -0
- package/skills/performing-network-computation/scripts/calculate_metrics.py +236 -0
- package/skills/performing-network-computation/scripts/detect_communities.py +281 -0
- package/skills/performing-network-computation/scripts/visualize_network.py +272 -0
- package/skills/performing-open-coding/SKILL.md +299 -0
- package/skills/performing-open-coding/pyproject.toml +35 -0
- package/skills/performing-open-coding/references/chinese-context.md +270 -0
- package/skills/performing-open-coding/references/examples.md +338 -0
- package/skills/performing-open-coding/references/theory.md +215 -0
- package/skills/performing-open-coding/references/troubleshooting.md +491 -0
- package/skills/performing-open-coding/scripts/__pycache__/auto_loader.cpython-312.pyc +0 -0
- package/skills/performing-open-coding/scripts/__pycache__/compare_codes.cpython-312.pyc +0 -0
- package/skills/performing-open-coding/scripts/__pycache__/preprocess_text.cpython-312.pyc +0 -0
- package/skills/performing-open-coding/scripts/auto_loader.py +195 -0
- package/skills/performing-open-coding/scripts/cluster_concepts.py +294 -0
- package/skills/performing-open-coding/scripts/clusters_test.json +169 -0
- package/skills/performing-open-coding/scripts/compare_codes.py +257 -0
- package/skills/performing-open-coding/scripts/comparison_test.json +19 -0
- package/skills/performing-open-coding/scripts/concepts_test.json +135 -0
- package/skills/performing-open-coding/scripts/preprocess_text.py +218 -0
- package/skills/performing-open-coding/scripts/test_output.json +134 -0
- package/skills/performing-open-coding/scripts/validate_codes.py +302 -0
- package/skills/performing-open-coding/scripts/validation_test.json +95 -0
- package/skills/performing-open-coding/tests/__pycache__/test_auto_loader.cpython-312-pytest-7.4.3.pyc +0 -0
- package/skills/performing-open-coding/tests/__pycache__/test_preprocess.cpython-312-pytest-7.4.3.pyc +0 -0
- package/skills/performing-open-coding/tests/run_integration_tests.py +148 -0
- package/skills/performing-open-coding/tests/test_auto_loader.py +233 -0
- package/skills/performing-open-coding/tests/test_compare_codes.py +336 -0
- package/skills/performing-open-coding/tests/test_preprocess.py +187 -0
- package/skills/performing-selective-coding/SKILL.md +305 -0
- package/skills/performing-selective-coding/pyproject.toml +21 -0
- package/skills/performing-selective-coding/references/README.md +86 -0
- package/skills/performing-selective-coding/references/core-category/INDEX.md +132 -0
- package/skills/performing-selective-coding/references/saturation/INDEX.md +153 -0
- package/skills/performing-selective-coding/references/storyline/INDEX.md +166 -0
- package/skills/performing-selective-coding/references/theory-integration/INDEX.md +203 -0
- package/skills/performing-selective-coding/scripts/README.md +101 -0
- package/skills/performing-selective-coding/scripts/__pycache__/check_saturation.cpython-312.pyc +0 -0
- package/skills/performing-selective-coding/scripts/__pycache__/identify_core_category.cpython-312.pyc +0 -0
- package/skills/performing-selective-coding/scripts/check_saturation.py +236 -0
- package/skills/performing-selective-coding/scripts/construct_storyline.py +237 -0
- package/skills/performing-selective-coding/scripts/identify_core_category.py +265 -0
- package/skills/performing-selective-coding/scripts/integrate_theory.py +173 -0
- package/skills/performing-selective-coding/tests/__pycache__/test_check_saturation.cpython-312-pytest-7.4.3.pyc +0 -0
- package/skills/performing-selective-coding/tests/__pycache__/test_identify_core_category.cpython-312-pytest-7.4.3.pyc +0 -0
- package/skills/performing-selective-coding/tests/test_check_saturation.py +157 -0
- package/skills/performing-selective-coding/tests/test_identify_core_category.py +157 -0
- package/skills/practical-marxist-application/SKILL.md +230 -0
- package/skills/processing-network-data/SKILL.md +146 -0
- package/skills/processing-network-data/pyproject.toml +33 -0
- package/skills/processing-network-data/scripts/clean_survey_data.py +285 -0
- package/skills/processing-network-data/scripts/extract_network_data.py +286 -0
- package/skills/processing-network-data/scripts/transform_data_format.py +334 -0
- package/skills/processing-network-data/scripts/validate_network_data.py +322 -0
- package/skills/pubscholar-auto-search/AGENTSKILLS_OPTIMIZATION_REPORT.md +540 -0
- package/skills/pubscholar-auto-search/README.md +66 -0
- package/skills/pubscholar-auto-search/SKILL.md +242 -0
- package/skills/pubscholar-auto-search/references/API_REFERENCE.md +349 -0
- package/skills/pubscholar-auto-search/references/DEVELOPMENT.md +395 -0
- package/skills/pubscholar-auto-search/references/EXTENSION_STRATEGIES.md +415 -0
- package/skills/pubscholar-auto-search/references/USER_GUIDE.md +432 -0
- package/skills/pubscholar-auto-search/requirements.txt +17 -0
- package/skills/pubscholar-auto-search/scripts/__pycache__/pubscholar_searcher.cpython-312.pyc +0 -0
- package/skills/pubscholar-auto-search/scripts/pubscholar_searcher.py +602 -0
- package/skills/pubscholar-auto-search/scripts/test_pubscholar_search.py +205 -0
- package/skills/research-design/DEPENDENCY_MANAGEMENT.md +112 -0
- package/skills/research-design/README.md +158 -0
- package/skills/research-design/SKILL.md +82 -0
- package/skills/research-design/assets/templates/research_design_template.md +297 -0
- package/skills/research-design/prompts/analysis-strategy-outline.md +307 -0
- package/skills/research-design/prompts/analysis-strategy.md +37 -0
- package/skills/research-design/prompts/data-planning-outline.md +204 -0
- package/skills/research-design/prompts/data-planning.md +36 -0
- package/skills/research-design/prompts/ethics-review-outline.md +406 -0
- package/skills/research-design/prompts/ethics-review.md +36 -0
- package/skills/research-design/prompts/method-selection-outline.md +181 -0
- package/skills/research-design/prompts/method-selection.md +36 -0
- package/skills/research-design/prompts/problem-definition-outline.md +107 -0
- package/skills/research-design/prompts/problem-definition.md +30 -0
- package/skills/research-design/pyproject.toml +35 -0
- package/skills/research-design/references/best-practices.md +185 -0
- package/skills/research-design/references/methodology.md +162 -0
- package/skills/research-design/scripts/__pycache__/design_evaluation.cpython-312.pyc +0 -0
- package/skills/research-design/scripts/__pycache__/integrated_analysis.cpython-312.pyc +0 -0
- package/skills/research-design/scripts/__pycache__/literature_analysis.cpython-312.pyc +0 -0
- package/skills/research-design/scripts/__pycache__/method_matching.cpython-312.pyc +0 -0
- package/skills/research-design/scripts/design_evaluation.py +670 -0
- package/skills/research-design/scripts/integrated_analysis.py +543 -0
- package/skills/research-design/scripts/literature_analysis.py +303 -0
- package/skills/research-design/scripts/method_matching.py +478 -0
- package/skills/research-design/test_research_design.py +281 -0
- package/skills/sna-analysis/integration_with_trusted_scraper.md +115 -0
- package/skills/spark-integration/INFO.md +64 -0
- package/skills/spark-integration/README.md +159 -0
- package/skills/spark-integration/SKILL.md +232 -0
- package/skills/spark-integration/skill.js +308 -0
- package/skills/spark-integration/skill.json +37 -0
- package/skills/trusted-web-scraper/CONFIG.yaml +60 -0
- package/skills/trusted-web-scraper/README.md +137 -0
- package/skills/trusted-web-scraper/SKILL.md +173 -0
- package/skills/trusted-web-scraper/final_test.json +240 -0
- package/skills/trusted-web-scraper/modules/__pycache__/core_trusted_scraper.cpython-312.pyc +0 -0
- package/skills/trusted-web-scraper/modules/__pycache__/scraper.cpython-312.pyc +0 -0
- package/skills/trusted-web-scraper/modules/__pycache__/trusted_web_scraper.cpython-312.pyc +0 -0
- package/skills/trusted-web-scraper/modules/core_trusted_scraper.py +778 -0
- package/skills/trusted-web-scraper/modules/scraper_minimal.py +623 -0
- package/skills/trusted-web-scraper/pyproject.toml +46 -0
- package/skills/trusted-web-scraper/scripts/__pycache__/trusted_web_scraper.cpython-312.pyc +0 -0
- package/skills/trusted-web-scraper/scripts/trusted_web_scraper.py +109 -0
- package/skills/trusted-web-scraper/test_comprehensive.py +53 -0
- package/skills/trusted-web-scraper/test_full.py +154 -0
- package/skills/trusted-web-scraper/test_input.json +10 -0
- package/skills/trusted-web-scraper/test_output.json +162 -0
- package/skills/trusted-web-scraper/test_output2.json +240 -0
- package/skills/trusted-web-scraper/test_output3.json +240 -0
- package/skills/trusted-web-scraper/test_output4.json +240 -0
- package/skills/validity-reliability/SKILL.md +130 -0
- package/skills/validity-reliability/pyproject.toml +36 -0
- package/skills/validity-reliability/scripts/validity_reliability_toolkit.py +480 -0
- package/skills/verify_compliance.ps1 +40 -0
- package/skills/visualization-expert/INFO.md +77 -0
- package/skills/visualization-expert/README.md +78 -0
- package/skills/visualization-expert/SKILL.md +374 -0
- package/skills/visualization-expert/prompts.txt +92 -0
- package/skills/visualization-expert/reference.md +212 -0
- package/skills/visualization-expert/skill.js +904 -0
- package/skills/visualization-expert/skill.json +195 -0
- package/skills/writing-grounded-theory-memos/SKILL.md +301 -0
|
@@ -0,0 +1,867 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
DID集成分析脚本 - 计量理论、统计方法、政策实践与数据科学的完美结合
|
|
5
|
+
根据AI分析决策,调用相应的定性提示词和定量算法
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import pandas as pd
|
|
9
|
+
import numpy as np
|
|
10
|
+
from typing import Dict, List, Tuple, Optional, Union, Any
|
|
11
|
+
import json
|
|
12
|
+
import os
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
import warnings
|
|
15
|
+
|
|
16
|
+
# 导入定量分析模块
|
|
17
|
+
from did_estimator import DIDEstimator
|
|
18
|
+
from parallel_trend import ParallelTrendTester
|
|
19
|
+
from robustness_test import RobustnessTester
|
|
20
|
+
from visualization import DIDVisualizer
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class IntegratedDIDAnalyzer:
|
|
24
|
+
"""集成DID分析器 - 理论与实践的完美结合"""
|
|
25
|
+
|
|
26
|
+
def __init__(self, skill_root: str):
|
|
27
|
+
self.skill_root = Path(skill_root)
|
|
28
|
+
self.prompts_dir = self.skill_root / "prompts"
|
|
29
|
+
self.scripts_dir = self.skill_root / "scripts"
|
|
30
|
+
self.references_dir = self.skill_root / "references"
|
|
31
|
+
|
|
32
|
+
# 初始化定量分析组件
|
|
33
|
+
self.estimator = DIDEstimator()
|
|
34
|
+
self.trend_tester = ParallelTrendTester()
|
|
35
|
+
self.robustness_tester = RobustnessTester()
|
|
36
|
+
self.visualizer = DIDVisualizer()
|
|
37
|
+
|
|
38
|
+
# 分析状态跟踪
|
|
39
|
+
self.analysis_state = {
|
|
40
|
+
'phase': 'initiated',
|
|
41
|
+
'experimental_design': None,
|
|
42
|
+
'model_specification': None,
|
|
43
|
+
'estimation_results': None,
|
|
44
|
+
'causal_interpretation': None,
|
|
45
|
+
'policy_recommendations': None
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
def load_prompt_content(self, prompt_name: str) -> str:
|
|
49
|
+
"""加载提示词内容"""
|
|
50
|
+
prompt_file = self.prompts_dir / f"{prompt_name}.md"
|
|
51
|
+
if not prompt_file.exists():
|
|
52
|
+
raise FileNotFoundError(f"提示词文件不存在: {prompt_file}")
|
|
53
|
+
|
|
54
|
+
with open(prompt_file, 'r', encoding='utf-8') as f:
|
|
55
|
+
return f.read()
|
|
56
|
+
|
|
57
|
+
def execute_experimental_design(self,
|
|
58
|
+
policy_context: Dict[str, Any]) -> Dict[str, Any]:
|
|
59
|
+
"""
|
|
60
|
+
执行实验设计阶段
|
|
61
|
+
|
|
62
|
+
这个方法会加载实验设计提示词,指导AI进行深度政策机制分析
|
|
63
|
+
"""
|
|
64
|
+
print("🎯 开始实验设计阶段...")
|
|
65
|
+
|
|
66
|
+
# 加载实验设计提示词
|
|
67
|
+
design_prompt = self.load_prompt_content("experimental-design")
|
|
68
|
+
|
|
69
|
+
# 构建实验设计指导
|
|
70
|
+
design_guidance = {
|
|
71
|
+
'prompt_content': design_prompt,
|
|
72
|
+
'policy_context': policy_context,
|
|
73
|
+
'design_focus': [
|
|
74
|
+
'policy_mechanism',
|
|
75
|
+
'group_selection',
|
|
76
|
+
'time_window',
|
|
77
|
+
'treatment_intensity'
|
|
78
|
+
],
|
|
79
|
+
'output_requirements': {
|
|
80
|
+
'mechanism_analysis': '政策作用机制分析',
|
|
81
|
+
'group_selection_plan': '实验组对照组选择方案',
|
|
82
|
+
'time_window_design': '时间窗口设计',
|
|
83
|
+
'variable_specification': '变量设定方案'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# 更新分析状态
|
|
88
|
+
self.analysis_state['phase'] = 'experimental_design'
|
|
89
|
+
self.analysis_state['experimental_design'] = design_guidance
|
|
90
|
+
|
|
91
|
+
return design_guidance
|
|
92
|
+
|
|
93
|
+
def execute_model_specification(self,
|
|
94
|
+
data: pd.DataFrame,
|
|
95
|
+
experimental_design: Dict[str, Any]) -> Dict[str, Any]:
|
|
96
|
+
"""
|
|
97
|
+
执行模型设定阶段
|
|
98
|
+
|
|
99
|
+
结合实验设计和数据特征,制定DID模型设定方案
|
|
100
|
+
"""
|
|
101
|
+
print("📊 制定DID模型设定...")
|
|
102
|
+
|
|
103
|
+
# 加载模型设定提示词
|
|
104
|
+
specification_prompt = self.load_prompt_content("model-specification")
|
|
105
|
+
|
|
106
|
+
# 数据特征分析
|
|
107
|
+
data_characteristics = self._analyze_panel_data_characteristics(data)
|
|
108
|
+
|
|
109
|
+
# 构建模型设定指导
|
|
110
|
+
specification_guidance = {
|
|
111
|
+
'prompt_content': specification_prompt,
|
|
112
|
+
'data_characteristics': data_characteristics,
|
|
113
|
+
'experimental_design': experimental_design,
|
|
114
|
+
'model_specifications': {},
|
|
115
|
+
'identification_strategy': {}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
# 为每个模型类型设定具体方案
|
|
119
|
+
model_types = ['twoway_fe', 'event_study', 'synthetic_control', 'heterogeneous_effects']
|
|
120
|
+
|
|
121
|
+
for model_type in model_types:
|
|
122
|
+
model_spec = self._create_model_specification(
|
|
123
|
+
model_type, data, data_characteristics, experimental_design
|
|
124
|
+
)
|
|
125
|
+
specification_guidance['model_specifications'][model_type] = model_spec
|
|
126
|
+
|
|
127
|
+
# 制定因果识别策略
|
|
128
|
+
specification_guidance['identification_strategy'] = self._create_identification_strategy(
|
|
129
|
+
data_characteristics, experimental_design
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
# 更新分析状态
|
|
133
|
+
self.analysis_state['phase'] = 'model_specification'
|
|
134
|
+
self.analysis_state['model_specification'] = specification_guidance
|
|
135
|
+
|
|
136
|
+
return specification_guidance
|
|
137
|
+
|
|
138
|
+
def execute_did_estimation(self,
|
|
139
|
+
data: pd.DataFrame,
|
|
140
|
+
entity_col: str,
|
|
141
|
+
time_col: str,
|
|
142
|
+
treatment_col: str,
|
|
143
|
+
outcome_col: str,
|
|
144
|
+
model_specification: Dict[str, Any]) -> Dict[str, Any]:
|
|
145
|
+
"""
|
|
146
|
+
执行DID估计阶段
|
|
147
|
+
|
|
148
|
+
根据模型设定执行具体的计量估计
|
|
149
|
+
"""
|
|
150
|
+
print("🔬 执行DID计量估计...")
|
|
151
|
+
|
|
152
|
+
# 第一步:平行趋势检验
|
|
153
|
+
print(" - 执行平行趋势检验...")
|
|
154
|
+
parallel_trend_results = self.trend_tester.test_parallel_trend(
|
|
155
|
+
data, entity_col, time_col, treatment_col, outcome_col
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# 第二步:基础DID估计
|
|
159
|
+
print(" - 估计基础DID模型...")
|
|
160
|
+
control_vars = model_specification.get('control_variables', [])
|
|
161
|
+
twoway_results = self.estimator.estimate_twoway_fe(
|
|
162
|
+
data, entity_col, time_col, treatment_col, outcome_col, control_vars
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# 第三步:事件研究估计
|
|
166
|
+
print(" - 估计事件研究模型...")
|
|
167
|
+
event_results = self.estimator.estimate_event_study(
|
|
168
|
+
data, entity_col, time_col, treatment_col, outcome_col, control_vars
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
# 第四步:异质性效应分析
|
|
172
|
+
print(" - 分析异质性效应...")
|
|
173
|
+
heterogeneity_vars = model_specification.get('heterogeneity_vars', [])
|
|
174
|
+
het_results = {}
|
|
175
|
+
if heterogeneity_vars:
|
|
176
|
+
het_results = self.estimator.estimate_heterogeneous_effects(
|
|
177
|
+
data, entity_col, time_col, treatment_col, outcome_col, heterogeneity_vars, control_vars
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
# 第五步:稳健性检验
|
|
181
|
+
print(" - 执行稳健性检验...")
|
|
182
|
+
robustness_results = self.robustness_tester.run_robustness_tests(
|
|
183
|
+
data, entity_col, time_col, treatment_col, outcome_col, twoway_results
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
# 整合估计结果
|
|
187
|
+
estimation_results = {
|
|
188
|
+
'parallel_trend_test': parallel_trend_results,
|
|
189
|
+
'twoway_fe': twoway_results,
|
|
190
|
+
'event_study': event_results,
|
|
191
|
+
'heterogeneous_effects': het_results,
|
|
192
|
+
'robustness_tests': robustness_results,
|
|
193
|
+
'data_summary': self._summarize_data(data, entity_col, time_col, treatment_col, outcome_col),
|
|
194
|
+
'quality_metrics': self._calculate_estimation_quality(
|
|
195
|
+
parallel_trend_results, twoway_results, robustness_results
|
|
196
|
+
)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
# 更新分析状态
|
|
200
|
+
self.analysis_state['phase'] = 'did_estimation'
|
|
201
|
+
self.analysis_state['estimation_results'] = estimation_results
|
|
202
|
+
|
|
203
|
+
return estimation_results
|
|
204
|
+
|
|
205
|
+
def execute_causal_interpretation(self,
|
|
206
|
+
estimation_results: Dict[str, Any],
|
|
207
|
+
experimental_design: Dict[str, Any]) -> Dict[str, Any]:
|
|
208
|
+
"""
|
|
209
|
+
执行因果解释阶段
|
|
210
|
+
|
|
211
|
+
加载因果解释提示词,指导AI进行深度因果机制阐释
|
|
212
|
+
"""
|
|
213
|
+
print("📝 深度解释因果效应...")
|
|
214
|
+
|
|
215
|
+
# 加载因果解释提示词
|
|
216
|
+
interpretation_prompt = self.load_prompt_content("causal-interpretation")
|
|
217
|
+
|
|
218
|
+
# 准备解释所需的信息
|
|
219
|
+
interpretation_context = {
|
|
220
|
+
'prompt_content': interpretation_prompt,
|
|
221
|
+
'estimation_results': estimation_results,
|
|
222
|
+
'experimental_design': experimental_design,
|
|
223
|
+
'interpretation_focus': [
|
|
224
|
+
'effect_size_interpretation',
|
|
225
|
+
'causal_mechanism',
|
|
226
|
+
'parallel_trend_assessment',
|
|
227
|
+
'robustness_evaluation',
|
|
228
|
+
'policy_implications'
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
# 生成解释指导
|
|
233
|
+
interpretation_guidance = self._create_interpretation_guidance(
|
|
234
|
+
estimation_results, experimental_design
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
interpretation_context['interpretation_guidance'] = interpretation_guidance
|
|
238
|
+
|
|
239
|
+
# 更新分析状态
|
|
240
|
+
self.analysis_state['phase'] = 'causal_interpretation'
|
|
241
|
+
self.analysis_state['causal_interpretation'] = interpretation_context
|
|
242
|
+
|
|
243
|
+
return interpretation_context
|
|
244
|
+
|
|
245
|
+
def execute_policy_recommendations(self,
|
|
246
|
+
causal_interpretation: Dict[str, Any],
|
|
247
|
+
policy_context: Dict[str, Any]) -> Dict[str, Any]:
|
|
248
|
+
"""
|
|
249
|
+
执行政策建议阶段
|
|
250
|
+
|
|
251
|
+
基于因果解释和政策背景制定政策建议
|
|
252
|
+
"""
|
|
253
|
+
print("🎯 制定政策建议...")
|
|
254
|
+
|
|
255
|
+
# 加载政策建议提示词
|
|
256
|
+
recommendation_prompt = self.load_prompt_content("policy-recommendation")
|
|
257
|
+
|
|
258
|
+
# 构建政策建议指导
|
|
259
|
+
recommendation_context = {
|
|
260
|
+
'prompt_content': recommendation_prompt,
|
|
261
|
+
'causal_interpretation': causal_interpretation,
|
|
262
|
+
'policy_context': policy_context,
|
|
263
|
+
'recommendation_types': [
|
|
264
|
+
'policy_continuation',
|
|
265
|
+
'policy_optimization',
|
|
266
|
+
'policy_expansion',
|
|
267
|
+
'policy_innovation'
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
# 生成政策建议指导
|
|
272
|
+
recommendation_guidance = self._create_policy_recommendation_guidance(
|
|
273
|
+
causal_interpretation, policy_context
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
recommendation_context['recommendation_guidance'] = recommendation_guidance
|
|
277
|
+
|
|
278
|
+
# 更新分析状态
|
|
279
|
+
self.analysis_state['phase'] = 'policy_recommendations'
|
|
280
|
+
self.analysis_state['policy_recommendations'] = recommendation_context
|
|
281
|
+
|
|
282
|
+
return recommendation_context
|
|
283
|
+
|
|
284
|
+
def _analyze_panel_data_characteristics(self, data: pd.DataFrame) -> Dict[str, Any]:
|
|
285
|
+
"""分析面板数据特征"""
|
|
286
|
+
characteristics = {}
|
|
287
|
+
|
|
288
|
+
# 基本数据结构
|
|
289
|
+
characteristics['data_structure'] = {
|
|
290
|
+
'n_rows': len(data),
|
|
291
|
+
'n_columns': len(data.columns),
|
|
292
|
+
'memory_usage': data.memory_usage(deep=True).sum()
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
# 面板数据特征
|
|
296
|
+
entity_col = data.select_dtypes(include=['object']).columns[0] if len(data.select_dtypes(include=['object']).columns) > 0 else None
|
|
297
|
+
time_col = data.select_dtypes(include=['int64', 'float64']).columns[0] if len(data.select_dtypes(include=['int64', 'float64']).columns) > 0 else None
|
|
298
|
+
|
|
299
|
+
if entity_col and time_col:
|
|
300
|
+
characteristics['panel_structure'] = {
|
|
301
|
+
'n_entities': data[entity_col].nunique(),
|
|
302
|
+
'n_periods': data[time_col].nunique(),
|
|
303
|
+
'balance_ratio': len(data) / (data[entity_col].nunique() * data[time_col].nunique()),
|
|
304
|
+
'time_span': [data[time_col].min(), data[time_col].max()]
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
# 变量特征
|
|
308
|
+
characteristics['variable_characteristics'] = {}
|
|
309
|
+
for col in data.columns:
|
|
310
|
+
if data[col].dtype in ['int64', 'float64']:
|
|
311
|
+
characteristics['variable_characteristics'][col] = {
|
|
312
|
+
'dtype': 'numeric',
|
|
313
|
+
'missing_rate': data[col].isna().sum() / len(data),
|
|
314
|
+
'mean': data[col].mean(),
|
|
315
|
+
'std': data[col].std(),
|
|
316
|
+
'min': data[col].min(),
|
|
317
|
+
'max': data[col].max()
|
|
318
|
+
}
|
|
319
|
+
else:
|
|
320
|
+
characteristics['variable_characteristics'][col] = {
|
|
321
|
+
'dtype': 'categorical',
|
|
322
|
+
'missing_rate': data[col].isna().sum() / len(data),
|
|
323
|
+
'n_unique': data[col].nunique(),
|
|
324
|
+
'most_frequent': data[col].mode().iloc[0] if len(data[col].mode()) > 0 else None
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return characteristics
|
|
328
|
+
|
|
329
|
+
def _create_model_specification(self,
|
|
330
|
+
model_type: str,
|
|
331
|
+
data: pd.DataFrame,
|
|
332
|
+
data_characteristics: Dict[str, Any],
|
|
333
|
+
experimental_design: Dict[str, Any]) -> Dict[str, Any]:
|
|
334
|
+
"""为特定模型类型创建设定方案"""
|
|
335
|
+
spec = {
|
|
336
|
+
'model_type': model_type,
|
|
337
|
+
'suitability': self._assess_model_suitability(model_type, data_characteristics),
|
|
338
|
+
'specification_details': {},
|
|
339
|
+
'identification_assumptions': [],
|
|
340
|
+
'data_requirements': {}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if model_type == 'twoway_fe':
|
|
344
|
+
spec['specification_details'] = {
|
|
345
|
+
'entity_effects': True,
|
|
346
|
+
'time_effects': True,
|
|
347
|
+
'interaction_term': 'treatment * post',
|
|
348
|
+
'control_variables': experimental_design.get('control_variables', [])
|
|
349
|
+
}
|
|
350
|
+
spec['identification_assumptions'] = [
|
|
351
|
+
'平行趋势假设',
|
|
352
|
+
'无预期效应',
|
|
353
|
+
'SUTVA假设'
|
|
354
|
+
]
|
|
355
|
+
|
|
356
|
+
elif model_type == 'event_study':
|
|
357
|
+
spec['specification_details'] = {
|
|
358
|
+
'event_time_dummies': True,
|
|
359
|
+
'reference_period': -1,
|
|
360
|
+
'dynamic_effects': True,
|
|
361
|
+
'leads_and_lags': True
|
|
362
|
+
}
|
|
363
|
+
spec['identification_assumptions'] = [
|
|
364
|
+
'平行趋势假设',
|
|
365
|
+
'无预期效应',
|
|
366
|
+
'效应线性性'
|
|
367
|
+
]
|
|
368
|
+
|
|
369
|
+
elif model_type == 'synthetic_control':
|
|
370
|
+
spec['specification_details'] = {
|
|
371
|
+
'treated_unit': experimental_design.get('treated_entity'),
|
|
372
|
+
'donor_pool': experimental_design.get('control_entities'),
|
|
373
|
+
'pre_treatment_periods': experimental_design.get('pre_period_length'),
|
|
374
|
+
'optimization_method': 'least_squares'
|
|
375
|
+
}
|
|
376
|
+
spec['identification_assumptions'] = [
|
|
377
|
+
'合成控制权重非负',
|
|
378
|
+
'权重和为1',
|
|
379
|
+
'无未观测因素干扰'
|
|
380
|
+
]
|
|
381
|
+
|
|
382
|
+
elif model_type == 'heterogeneous_effects':
|
|
383
|
+
spec['specification_details'] = {
|
|
384
|
+
'heterogeneity_vars': experimental_design.get('heterogeneity_vars', []),
|
|
385
|
+
'interaction_terms': True,
|
|
386
|
+
'subgroup_analysis': True
|
|
387
|
+
}
|
|
388
|
+
spec['identification_assumptions'] = [
|
|
389
|
+
'平行趋势假设在各组成立',
|
|
390
|
+
'异质性外生性'
|
|
391
|
+
]
|
|
392
|
+
|
|
393
|
+
return spec
|
|
394
|
+
|
|
395
|
+
def _assess_model_suitability(self, model_type: str, data_characteristics: Dict[str, Any]) -> str:
|
|
396
|
+
"""评估模型适合性"""
|
|
397
|
+
if 'panel_structure' not in data_characteristics:
|
|
398
|
+
return 'unknown'
|
|
399
|
+
|
|
400
|
+
n_entities = data_characteristics['panel_structure']['n_entities']
|
|
401
|
+
n_periods = data_characteristics['panel_structure']['n_periods']
|
|
402
|
+
balance_ratio = data_characteristics['panel_structure']['balance_ratio']
|
|
403
|
+
|
|
404
|
+
if model_type == 'twoway_fe':
|
|
405
|
+
if n_entities >= 10 and n_periods >= 3 and balance_ratio > 0.7:
|
|
406
|
+
return 'highly_suitable'
|
|
407
|
+
elif n_entities >= 5 and n_periods >= 2:
|
|
408
|
+
return 'moderately_suitable'
|
|
409
|
+
else:
|
|
410
|
+
return 'not_suitable'
|
|
411
|
+
|
|
412
|
+
elif model_type == 'event_study':
|
|
413
|
+
if n_periods >= 5 and balance_ratio > 0.8:
|
|
414
|
+
return 'highly_suitable'
|
|
415
|
+
elif n_periods >= 3:
|
|
416
|
+
return 'moderately_suitable'
|
|
417
|
+
else:
|
|
418
|
+
return 'not_suitable'
|
|
419
|
+
|
|
420
|
+
elif model_type == 'synthetic_control':
|
|
421
|
+
if n_entities >= 20 and n_periods >= 5:
|
|
422
|
+
return 'highly_suitable'
|
|
423
|
+
elif n_entities >= 10 and n_periods >= 3:
|
|
424
|
+
return 'moderately_suitable'
|
|
425
|
+
else:
|
|
426
|
+
return 'not_suitable'
|
|
427
|
+
|
|
428
|
+
elif model_type == 'heterogeneous_effects':
|
|
429
|
+
if n_entities >= 20:
|
|
430
|
+
return 'highly_suitable'
|
|
431
|
+
elif n_entities >= 10:
|
|
432
|
+
return 'moderately_suitable'
|
|
433
|
+
else:
|
|
434
|
+
return 'not_suitable'
|
|
435
|
+
|
|
436
|
+
return 'unknown'
|
|
437
|
+
|
|
438
|
+
def _create_identification_strategy(self,
|
|
439
|
+
data_characteristics: Dict[str, Any],
|
|
440
|
+
experimental_design: Dict[str, Any]) -> Dict[str, Any]:
|
|
441
|
+
"""创建因果识别策略"""
|
|
442
|
+
strategy = {
|
|
443
|
+
'primary_strategy': 'difference_in_differences',
|
|
444
|
+
'identification_assumptions': [],
|
|
445
|
+
'threats_to_identification': [],
|
|
446
|
+
'mitigation_strategies': []
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
# 基本DID假设
|
|
450
|
+
strategy['identification_assumptions'] = [
|
|
451
|
+
'平行趋势假设',
|
|
452
|
+
'无预期效应',
|
|
453
|
+
'处理外生性',
|
|
454
|
+
'稳定单位处理值假设(SUTVA)',
|
|
455
|
+
'无同时期其他政策干预'
|
|
456
|
+
]
|
|
457
|
+
|
|
458
|
+
# 识别威胁
|
|
459
|
+
strategy['threats_to_identification'] = [
|
|
460
|
+
'处理组和对照组趋势差异',
|
|
461
|
+
'预期效应存在',
|
|
462
|
+
'处理内生性',
|
|
463
|
+
'同时期政策干扰',
|
|
464
|
+
'测量误差'
|
|
465
|
+
]
|
|
466
|
+
|
|
467
|
+
# 缓解策略
|
|
468
|
+
strategy['mitigation_strategies'] = [
|
|
469
|
+
'平行趋势检验',
|
|
470
|
+
'事件研究分析',
|
|
471
|
+
'工具变量法',
|
|
472
|
+
'安慰剂检验',
|
|
473
|
+
'稳健性检验'
|
|
474
|
+
]
|
|
475
|
+
|
|
476
|
+
return strategy
|
|
477
|
+
|
|
478
|
+
def _summarize_data(self, data: pd.DataFrame, entity_col: str, time_col: str,
|
|
479
|
+
treatment_col: str, outcome_col: str) -> Dict[str, Any]:
|
|
480
|
+
"""总结数据特征"""
|
|
481
|
+
summary = {}
|
|
482
|
+
|
|
483
|
+
# 处理组统计
|
|
484
|
+
treated_data = data[data[treatment_col] == 1]
|
|
485
|
+
control_data = data[data[treatment_col] == 0]
|
|
486
|
+
|
|
487
|
+
summary['treatment_stats'] = {
|
|
488
|
+
'n_treated_entities': treated_data[entity_col].nunique(),
|
|
489
|
+
'n_control_entities': control_data[entity_col].nunique(),
|
|
490
|
+
'treatment_rate': len(treated_data) / len(data),
|
|
491
|
+
'outcome_mean_treated': treated_data[outcome_col].mean(),
|
|
492
|
+
'outcome_mean_control': control_data[outcome_col].mean()
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
# 时间趋势
|
|
496
|
+
time_trends = data.groupby([time_col, treatment_col])[outcome_col].mean().unstack()
|
|
497
|
+
summary['time_trends'] = time_trends.to_dict()
|
|
498
|
+
|
|
499
|
+
return summary
|
|
500
|
+
|
|
501
|
+
def _calculate_estimation_quality(self,
|
|
502
|
+
parallel_trend_results: Dict[str, Any],
|
|
503
|
+
twoway_results: Dict[str, Any],
|
|
504
|
+
robustness_results: Dict[str, Any]) -> Dict[str, Any]:
|
|
505
|
+
"""计算估计质量指标"""
|
|
506
|
+
quality = {}
|
|
507
|
+
|
|
508
|
+
# 平行趋势检验质量
|
|
509
|
+
if 'parallel_trend_pvalue' in parallel_trend_results:
|
|
510
|
+
quality['parallel_trend'] = {
|
|
511
|
+
'assumption_met': parallel_trend_results['parallel_trend_pvalue'] > 0.05,
|
|
512
|
+
'p_value': parallel_trend_results['parallel_trend_pvalue'],
|
|
513
|
+
'confidence': 'high' if parallel_trend_results['parallel_trend_pvalue'] > 0.1 else 'medium'
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
# DID估计质量
|
|
517
|
+
quality['did_estimation'] = {
|
|
518
|
+
'statistical_significance': twoway_results['did_pvalue'] < 0.05,
|
|
519
|
+
'effect_size': abs(twoway_results['did_effect']),
|
|
520
|
+
'precision': twoway_results['did_se'] / abs(twoway_results['did_effect']),
|
|
521
|
+
'model_fit': twoway_results['r_squared']
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
# 稳健性质量
|
|
525
|
+
if 'placebo_pvalue' in robustness_results:
|
|
526
|
+
quality['robustness'] = {
|
|
527
|
+
'placebo_test_passed': robustness_results['placebo_pvalue'] < 0.05,
|
|
528
|
+
'sensitivity_analysis': 'stable' if robustness_results.get('sensitivity_stable', False) else 'unstable'
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
# 综合质量分数
|
|
532
|
+
quality_scores = []
|
|
533
|
+
if 'parallel_trend' in quality:
|
|
534
|
+
quality_scores.append(1.0 if quality['parallel_trend']['assumption_met'] else 0.5)
|
|
535
|
+
if 'did_estimation' in quality:
|
|
536
|
+
quality_scores.append(min(1.0, quality['did_estimation']['model_fit'] * 2))
|
|
537
|
+
if 'robustness' in quality:
|
|
538
|
+
quality_scores.append(1.0 if quality['robustness']['placebo_test_passed'] else 0.5)
|
|
539
|
+
|
|
540
|
+
quality['overall_quality'] = np.mean(quality_scores) if quality_scores else 0.5
|
|
541
|
+
|
|
542
|
+
return quality
|
|
543
|
+
|
|
544
|
+
def _create_interpretation_guidance(self,
|
|
545
|
+
estimation_results: Dict[str, Any],
|
|
546
|
+
experimental_design: Dict[str, Any]) -> Dict[str, Any]:
|
|
547
|
+
"""创建因果解释指导"""
|
|
548
|
+
guidance = {
|
|
549
|
+
'effect_interpretation': {},
|
|
550
|
+
'mechanism_analysis': {},
|
|
551
|
+
'robustness_assessment': {},
|
|
552
|
+
'interpretation_questions': []
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
# 效应解释指导
|
|
556
|
+
if 'twoway_fe' in estimation_results:
|
|
557
|
+
did_results = estimation_results['twoway_fe']
|
|
558
|
+
guidance['effect_interpretation'] = {
|
|
559
|
+
'point_estimate': did_results['did_effect'],
|
|
560
|
+
'confidence_interval': [did_results['did_ci_lower'], did_results['did_ci_upper']],
|
|
561
|
+
'statistical_significance': did_results['did_pvalue'],
|
|
562
|
+
'economic_significance': self._assess_economic_significance(did_results),
|
|
563
|
+
'interpretation_focus': [
|
|
564
|
+
'效应大小的实际含义',
|
|
565
|
+
'置信区间的政策含义',
|
|
566
|
+
'统计显著性与实际意义的关系'
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
# 机制分析指导
|
|
571
|
+
guidance['mechanism_analysis'] = {
|
|
572
|
+
'parallel_trend_status': estimation_results.get('parallel_trend_test', {}),
|
|
573
|
+
'dynamic_effects': estimation_results.get('event_study', {}),
|
|
574
|
+
'heterogeneity_patterns': estimation_results.get('heterogeneous_effects', {}),
|
|
575
|
+
'analysis_questions': [
|
|
576
|
+
'政策通过什么渠道产生效应?',
|
|
577
|
+
'效应是否随时间变化?',
|
|
578
|
+
'不同群体的效应差异如何解释?'
|
|
579
|
+
]
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
# 稳健性评估指导
|
|
583
|
+
guidance['robustness_assessment'] = {
|
|
584
|
+
'robustness_results': estimation_results.get('robustness_tests', {}),
|
|
585
|
+
'quality_metrics': estimation_results.get('quality_metrics', {}),
|
|
586
|
+
'assessment_criteria': [
|
|
587
|
+
'平行趋势假设是否满足?',
|
|
588
|
+
'安慰剂检验是否通过?',
|
|
589
|
+
'不同模型设定的结果是否一致?'
|
|
590
|
+
]
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
# 解释问题
|
|
594
|
+
guidance['interpretation_questions'] = [
|
|
595
|
+
"估计的因果效应在理论和实践上意味着什么?",
|
|
596
|
+
"平行趋势假设的满足程度如何影响因果推断的可靠性?",
|
|
597
|
+
"异质性效应揭示的政策含义是什么?",
|
|
598
|
+
"稳健性检验结果对因果推断的信心有何影响?",
|
|
599
|
+
"研究结果对政策制定有什么具体指导意义?"
|
|
600
|
+
]
|
|
601
|
+
|
|
602
|
+
return guidance
|
|
603
|
+
|
|
604
|
+
def _assess_economic_significance(self, did_results: Dict[str, Any]) -> str:
|
|
605
|
+
"""评估经济显著性"""
|
|
606
|
+
effect_size = abs(did_results['did_effect'])
|
|
607
|
+
|
|
608
|
+
# 简化的经济显著性评估(实际应用中需要具体领域知识)
|
|
609
|
+
if effect_size > 10:
|
|
610
|
+
return 'large'
|
|
611
|
+
elif effect_size > 5:
|
|
612
|
+
return 'medium'
|
|
613
|
+
elif effect_size > 1:
|
|
614
|
+
return 'small'
|
|
615
|
+
else:
|
|
616
|
+
return 'minimal'
|
|
617
|
+
|
|
618
|
+
def _create_policy_recommendation_guidance(self,
|
|
619
|
+
causal_interpretation: Dict[str, Any],
|
|
620
|
+
policy_context: Dict[str, Any]) -> Dict[str, Any]:
|
|
621
|
+
"""创建政策建议指导"""
|
|
622
|
+
guidance = {
|
|
623
|
+
'effectiveness_assessment': {},
|
|
624
|
+
'recommendation_types': {},
|
|
625
|
+
'implementation_considerations': {},
|
|
626
|
+
'risk_assessment': {}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
# 有效性评估
|
|
630
|
+
if 'estimation_results' in causal_interpretation:
|
|
631
|
+
estimation = causal_interpretation['estimation_results']
|
|
632
|
+
guidance['effectiveness_assessment'] = {
|
|
633
|
+
'policy_effectiveness': self._assess_policy_effectiveness(estimation),
|
|
634
|
+
'cost_benefit_considerations': self._generate_cost_benefit_considerations(estimation),
|
|
635
|
+
'target_group_benefits': self._identify_target_group_benefits(estimation)
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
# 建议类型
|
|
639
|
+
guidance['recommendation_types'] = {
|
|
640
|
+
'continuation': {
|
|
641
|
+
'condition': 'effect_positive_and_significant',
|
|
642
|
+
'rationale': '政策产生了预期效果'
|
|
643
|
+
},
|
|
644
|
+
'optimization': {
|
|
645
|
+
'condition': 'effect_moderate_or_heterogeneous',
|
|
646
|
+
'rationale': '政策有改进空间'
|
|
647
|
+
},
|
|
648
|
+
'expansion': {
|
|
649
|
+
'condition': 'effect_large_and_robust',
|
|
650
|
+
'rationale': '政策效果显著且稳健'
|
|
651
|
+
},
|
|
652
|
+
'termination': {
|
|
653
|
+
'condition': 'effect_negative_or_insignificant',
|
|
654
|
+
'rationale': '政策未产生预期效果'
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
# 实施考虑
|
|
659
|
+
guidance['implementation_considerations'] = {
|
|
660
|
+
'scalability': '政策是否可以扩大规模?',
|
|
661
|
+
'resource_requirements': '实施政策需要什么资源?',
|
|
662
|
+
'institutional_capacity': '是否有足够的制度能力?',
|
|
663
|
+
'political_feasibility': '政治上是否可行?'
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
# 风险评估
|
|
667
|
+
guidance['risk_assessment'] = {
|
|
668
|
+
'external_validity': '结果是否可以推广到其他情境?',
|
|
669
|
+
'unintended_consequences': '是否存在潜在的负面效应?',
|
|
670
|
+
'sustainability': '政策效果是否可持续?',
|
|
671
|
+
'equity_implications': '政策对不同群体的影响是否公平?'
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
return guidance
|
|
675
|
+
|
|
676
|
+
def _assess_policy_effectiveness(self, estimation_results: Dict[str, Any]) -> str:
|
|
677
|
+
"""评估政策有效性"""
|
|
678
|
+
if 'twoway_fe' not in estimation_results:
|
|
679
|
+
return 'unknown'
|
|
680
|
+
|
|
681
|
+
did_results = estimation_results['twoway_fe']
|
|
682
|
+
effect = did_results['did_effect']
|
|
683
|
+
pvalue = did_results['did_pvalue']
|
|
684
|
+
|
|
685
|
+
if pvalue < 0.05 and effect > 0:
|
|
686
|
+
return 'effective'
|
|
687
|
+
elif pvalue < 0.05 and effect < 0:
|
|
688
|
+
return 'counterproductive'
|
|
689
|
+
elif pvalue >= 0.05:
|
|
690
|
+
return 'ineffective'
|
|
691
|
+
else:
|
|
692
|
+
return 'unclear'
|
|
693
|
+
|
|
694
|
+
def _generate_cost_benefit_considerations(self, estimation_results: Dict[str, Any]) -> List[str]:
|
|
695
|
+
"""生成成本效益考虑"""
|
|
696
|
+
return [
|
|
697
|
+
"政策实施成本与效应大小的比较",
|
|
698
|
+
"长期效应与短期效应的权衡",
|
|
699
|
+
"直接效应与间接效应的综合评估",
|
|
700
|
+
"可量化收益与不可量化收益的平衡"
|
|
701
|
+
]
|
|
702
|
+
|
|
703
|
+
def _identify_target_group_benefits(self, estimation_results: Dict[str, Any]) -> List[str]:
|
|
704
|
+
"""识别目标群体收益"""
|
|
705
|
+
benefits = []
|
|
706
|
+
|
|
707
|
+
if 'heterogeneous_effects' in estimation_results:
|
|
708
|
+
het_results = estimation_results['heterogeneous_effects']
|
|
709
|
+
for var, effects in het_results.items():
|
|
710
|
+
if 'group_effects' in effects:
|
|
711
|
+
for group, effect in effects['group_effects'].items():
|
|
712
|
+
if effect > 0:
|
|
713
|
+
benefits.append(f"{var}={group}群体: 正面效应")
|
|
714
|
+
|
|
715
|
+
return benefits
|
|
716
|
+
|
|
717
|
+
def generate_comprehensive_report(self, output_file: str = None) -> str:
|
|
718
|
+
"""生成完整的DID分析报告"""
|
|
719
|
+
report_sections = []
|
|
720
|
+
|
|
721
|
+
# 报告标题
|
|
722
|
+
report_sections.append("# DID因果推断分析报告\n")
|
|
723
|
+
|
|
724
|
+
# 实验设计部分
|
|
725
|
+
if self.analysis_state['experimental_design']:
|
|
726
|
+
report_sections.append("## 🎯 实验设计\n")
|
|
727
|
+
report_sections.append("实验设计已完成,详见实验设计指导文档。\n")
|
|
728
|
+
|
|
729
|
+
# 模型设定部分
|
|
730
|
+
if self.analysis_state['model_specification']:
|
|
731
|
+
report_sections.append("## 📊 模型设定\n")
|
|
732
|
+
model_spec = self.analysis_state['model_specification']
|
|
733
|
+
report_sections.append("模型设定方案已制定,包含多种DID估计方法。\n")
|
|
734
|
+
|
|
735
|
+
# 估计结果部分
|
|
736
|
+
if self.analysis_state['estimation_results']:
|
|
737
|
+
report_sections.append("## 🔬 DID估计结果\n")
|
|
738
|
+
results = self.analysis_state['estimation_results']
|
|
739
|
+
|
|
740
|
+
report_sections.append("### 主要估计结果\n")
|
|
741
|
+
if 'twoway_fe' in results:
|
|
742
|
+
did = results['twoway_fe']
|
|
743
|
+
report_sections.append(f"- DID效应: {did['did_effect']:.4f} (p={did['did_pvalue']:.4f})\n")
|
|
744
|
+
report_sections.append(f"- 95%置信区间: [{did['did_ci_lower']:.4f}, {did['did_ci_upper']:.4f}]\n")
|
|
745
|
+
report_sections.append(f"- R²: {did['r_squared']:.4f}\n")
|
|
746
|
+
|
|
747
|
+
report_sections.append("### 平行趋势检验\n")
|
|
748
|
+
if 'parallel_trend_test' in results:
|
|
749
|
+
pt = results['parallel_trend_test']
|
|
750
|
+
if 'parallel_trend_pvalue' in pt:
|
|
751
|
+
report_sections.append(f"- 平行趋势检验p值: {pt['parallel_trend_pvalue']:.4f}\n")
|
|
752
|
+
|
|
753
|
+
report_sections.append("### 稳健性检验\n")
|
|
754
|
+
if 'robustness_tests' in results:
|
|
755
|
+
rt = results['robustness_tests']
|
|
756
|
+
if 'placebo_pvalue' in rt:
|
|
757
|
+
report_sections.append(f"- 安慰剂检验p值: {rt['placebo_pvalue']:.4f}\n")
|
|
758
|
+
|
|
759
|
+
# 因果解释部分
|
|
760
|
+
if self.analysis_state['causal_interpretation']:
|
|
761
|
+
report_sections.append("## 📝 因果解释\n")
|
|
762
|
+
interpretation = self.analysis_state['causal_interpretation']
|
|
763
|
+
report_sections.append("因果解释指导已生成,请参考因果解释提示词进行深度分析。\n")
|
|
764
|
+
|
|
765
|
+
# 政策建议部分
|
|
766
|
+
if self.analysis_state['policy_recommendations']:
|
|
767
|
+
report_sections.append("## 🎯 政策建议\n")
|
|
768
|
+
recommendations = self.analysis_state['policy_recommendations']
|
|
769
|
+
report_sections.append("政策建议指导已生成,请参考政策建议提示词制定具体建议。\n")
|
|
770
|
+
|
|
771
|
+
# 生成报告
|
|
772
|
+
report = "\n".join(report_sections)
|
|
773
|
+
|
|
774
|
+
# 保存报告
|
|
775
|
+
if output_file:
|
|
776
|
+
with open(output_file, 'w', encoding='utf-8') as f:
|
|
777
|
+
f.write(report)
|
|
778
|
+
print(f"DID分析报告已保存到: {output_file}")
|
|
779
|
+
|
|
780
|
+
return report
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
def main():
|
|
784
|
+
"""示例用法"""
|
|
785
|
+
# 设置技能根目录
|
|
786
|
+
skill_root = "D:/stigmergy-CLI-Multi-Agents/sscisubagent-skills/did-analysis"
|
|
787
|
+
|
|
788
|
+
# 初始化集成分析器
|
|
789
|
+
analyzer = IntegratedDIDAnalyzer(skill_root)
|
|
790
|
+
|
|
791
|
+
# 创建示例面板数据
|
|
792
|
+
np.random.seed(42)
|
|
793
|
+
n_entities = 30
|
|
794
|
+
n_periods = 8
|
|
795
|
+
entities = [f"entity_{i}" for i in range(n_entities)]
|
|
796
|
+
periods = list(range(2015, 2015 + n_periods))
|
|
797
|
+
|
|
798
|
+
data = []
|
|
799
|
+
for entity in entities:
|
|
800
|
+
base_outcome = 100 + np.random.normal(0, 10)
|
|
801
|
+
entity_fe = np.random.normal(0, 5)
|
|
802
|
+
|
|
803
|
+
for period in periods:
|
|
804
|
+
time_fe = (period - 2015) * 2
|
|
805
|
+
treat = 0
|
|
806
|
+
|
|
807
|
+
# 处理效应
|
|
808
|
+
if entity in ['entity_1', 'entity_2', 'entity_3'] and period >= 2018:
|
|
809
|
+
treat = 1
|
|
810
|
+
treatment_effect = 15
|
|
811
|
+
else:
|
|
812
|
+
treatment_effect = 0
|
|
813
|
+
|
|
814
|
+
outcome = (base_outcome + entity_fe + time_fe + treatment_effect +
|
|
815
|
+
np.random.normal(0, 5))
|
|
816
|
+
|
|
817
|
+
data.append({
|
|
818
|
+
'entity': entity,
|
|
819
|
+
'year': period,
|
|
820
|
+
'treatment': treat,
|
|
821
|
+
'outcome': outcome,
|
|
822
|
+
'control_var1': np.random.normal(0, 1),
|
|
823
|
+
'control_var2': np.random.normal(0, 1)
|
|
824
|
+
})
|
|
825
|
+
|
|
826
|
+
df = pd.DataFrame(data)
|
|
827
|
+
|
|
828
|
+
print("🚀 开始DID集成分析...")
|
|
829
|
+
|
|
830
|
+
# 第一步:实验设计
|
|
831
|
+
policy_context = {
|
|
832
|
+
'policy_name': '教育质量提升政策',
|
|
833
|
+
'policy_objective': '提高学生学业成绩',
|
|
834
|
+
'implementation_year': 2018,
|
|
835
|
+
'target_population': '中小学学生'
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
experimental_design = analyzer.execute_experimental_design(policy_context)
|
|
839
|
+
|
|
840
|
+
# 第二步:模型设定
|
|
841
|
+
model_specification = analyzer.execute_model_specification(df, experimental_design)
|
|
842
|
+
|
|
843
|
+
# 第三步:DID估计
|
|
844
|
+
estimation_results = analyzer.execute_did_estimation(
|
|
845
|
+
df, 'entity', 'year', 'treatment', 'outcome', model_specification
|
|
846
|
+
)
|
|
847
|
+
|
|
848
|
+
# 第四步:因果解释
|
|
849
|
+
causal_interpretation = analyzer.execute_causal_interpretation(
|
|
850
|
+
estimation_results, experimental_design
|
|
851
|
+
)
|
|
852
|
+
|
|
853
|
+
# 第五步:政策建议
|
|
854
|
+
policy_recommendations = analyzer.execute_policy_recommendations(
|
|
855
|
+
causal_interpretation, policy_context
|
|
856
|
+
)
|
|
857
|
+
|
|
858
|
+
# 生成报告
|
|
859
|
+
report = analyzer.generate_comprehensive_report("did_analysis_report.md")
|
|
860
|
+
|
|
861
|
+
print("✅ DID集成分析完成!")
|
|
862
|
+
print(f"分析阶段: {analyzer.analysis_state['phase']}")
|
|
863
|
+
print("详细报告已生成,请查看各阶段的提示词指导进行深度分析。")
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
if __name__ == "__main__":
|
|
867
|
+
main()
|