aped-method 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/bin/aped-method.js +8 -0
- package/package.json +31 -0
- package/src/index.js +348 -0
- package/src/scaffold.js +21 -0
- package/src/templates/commands.js +65 -0
- package/src/templates/config.js +230 -0
- package/src/templates/data/domain-complexity.csv +15 -0
- package/src/templates/data/project-types.csv +11 -0
- package/src/templates/guardrail.js +171 -0
- package/src/templates/index.js +17 -0
- package/src/templates/references.js +549 -0
- package/src/templates/scripts.js +345 -0
- package/src/templates/skills.js +412 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
domain,signals,complexity,key_concerns,required_knowledge,suggested_workflow,web_searches,special_sections
|
|
2
|
+
healthcare,"medical,diagnostic,clinical,FDA,patient,treatment,HIPAA,therapy,pharma,drug",high,"FDA approval;Clinical validation;HIPAA compliance;Patient safety;Medical device classification;Liability","Regulatory pathways;Clinical trial design;Medical standards;Data privacy;Integration requirements","domain-research","FDA software medical device guidance {date};HIPAA compliance software requirements;Medical software standards {date};Clinical validation software","clinical_requirements;regulatory_pathway;validation_methodology;safety_measures"
|
|
3
|
+
fintech,"payment,banking,trading,investment,crypto,wallet,transaction,KYC,AML,funds,fintech",high,"Regional compliance;Security standards;Audit requirements;Fraud prevention;Data protection","KYC/AML requirements;PCI DSS;Open banking;Regional laws (US/EU/APAC);Crypto regulations","domain-research","fintech regulations {date};payment processing compliance {date};open banking API standards;cryptocurrency regulations {date}","compliance_matrix;security_architecture;audit_requirements;fraud_prevention"
|
|
4
|
+
govtech,"government,federal,civic,public sector,citizen,municipal,voting",high,"Procurement rules;Security clearance;Accessibility (508);FedRAMP;Privacy;Transparency","Government procurement;Security frameworks;Accessibility standards;Privacy laws;Open data requirements","domain-research","government software procurement {date};FedRAMP compliance requirements;section 508 accessibility;government security standards","procurement_compliance;security_clearance;accessibility_standards;transparency_requirements"
|
|
5
|
+
edtech,"education,learning,student,teacher,curriculum,assessment,K-12,university,LMS",medium,"Student privacy (COPPA/FERPA);Accessibility;Content moderation;Age verification;Curriculum standards","Educational privacy laws;Learning standards;Accessibility requirements;Content guidelines;Assessment validity","domain-research","educational software privacy {date};COPPA FERPA compliance;WCAG education requirements;learning management standards","privacy_compliance;content_guidelines;accessibility_features;curriculum_alignment"
|
|
6
|
+
aerospace,"aircraft,spacecraft,aviation,drone,satellite,propulsion,flight,radar,navigation",high,"Safety certification;DO-178C compliance;Performance validation;Simulation accuracy;Export controls","Aviation standards;Safety analysis;Simulation validation;ITAR/export controls;Performance requirements","domain-research + technical-model","DO-178C software certification;aerospace simulation standards {date};ITAR export controls software;aviation safety requirements","safety_certification;simulation_validation;performance_requirements;export_compliance"
|
|
7
|
+
automotive,"vehicle,car,autonomous,ADAS,automotive,driving,EV,charging",high,"Safety standards;ISO 26262;V2X communication;Real-time requirements;Certification","Automotive standards;Functional safety;V2X protocols;Real-time systems;Testing requirements","domain-research","ISO 26262 automotive software;automotive safety standards {date};V2X communication protocols;EV charging standards","safety_standards;functional_safety;communication_protocols;certification_requirements"
|
|
8
|
+
scientific,"research,algorithm,simulation,modeling,computational,analysis,data science,ML,AI",medium,"Reproducibility;Validation methodology;Peer review;Performance;Accuracy;Computational resources","Scientific method;Statistical validity;Computational requirements;Domain expertise;Publication standards","technical-model","scientific computing best practices {date};research reproducibility standards;computational modeling validation;peer review software","validation_methodology;accuracy_metrics;reproducibility_plan;computational_requirements"
|
|
9
|
+
legaltech,"legal,law,contract,compliance,litigation,patent,attorney,court",high,"Legal ethics;Bar regulations;Data retention;Attorney-client privilege;Court system integration","Legal practice rules;Ethics requirements;Court filing systems;Document standards;Confidentiality","domain-research","legal technology ethics {date};law practice management software requirements;court filing system standards;attorney client privilege technology","ethics_compliance;data_retention;confidentiality_measures;court_integration"
|
|
10
|
+
insuretech,"insurance,claims,underwriting,actuarial,policy,risk,premium",high,"Insurance regulations;Actuarial standards;Data privacy;Fraud detection;State compliance","Insurance regulations by state;Actuarial methods;Risk modeling;Claims processing;Regulatory reporting","domain-research","insurance software regulations {date};actuarial standards software;insurance fraud detection;state insurance compliance","regulatory_requirements;risk_modeling;fraud_detection;reporting_compliance"
|
|
11
|
+
energy,"energy,utility,grid,solar,wind,power,electricity,oil,gas",high,"Grid compliance;NERC standards;Environmental regulations;Safety requirements;Real-time operations","Energy regulations;Grid standards;Environmental compliance;Safety protocols;SCADA systems","domain-research","energy sector software compliance {date};NERC CIP standards;smart grid requirements;renewable energy software standards","grid_compliance;safety_protocols;environmental_compliance;operational_requirements"
|
|
12
|
+
process_control,"industrial automation,process control,PLC,SCADA,DCS,HMI,operational technology,OT,control system,cyberphysical,MES,historian,instrumentation,I&C,P&ID",high,"Functional safety;OT cybersecurity;Real-time control requirements;Legacy system integration;Process safety and hazard analysis;Environmental compliance and permitting;Engineering authority and PE requirements","Functional safety standards;OT security frameworks;Industrial protocols;Process control architecture;Plant reliability and maintainability","domain-research + technical-model","IEC 62443 OT cybersecurity requirements {date};functional safety software requirements {date};industrial process control architecture;ISA-95 manufacturing integration","functional_safety;ot_security;process_requirements;engineering_authority"
|
|
13
|
+
building_automation,"building automation,BAS,BMS,HVAC,smart building,lighting control,fire alarm,fire protection,fire suppression,life safety,elevator,access control,DDC,energy management,sequence of operations,commissioning",high,"Life safety codes;Building energy standards;Multi-trade coordination and interoperability;Commissioning and ongoing operational performance;Indoor environmental quality and occupant comfort;Engineering authority and PE requirements","Building automation protocols;HVAC and mechanical controls;Fire alarm, fire protection, and life safety design;Commissioning process and sequence of operations;Building codes and energy standards","domain-research","smart building software architecture {date};BACnet integration best practices;building automation cybersecurity {date};ASHRAE building standards","life_safety;energy_compliance;commissioning_requirements;engineering_authority"
|
|
14
|
+
gaming,"game,player,gameplay,level,character,multiplayer,quest",redirect,"REDIRECT TO GAME WORKFLOWS","Game design","game-brief","NA","NA"
|
|
15
|
+
general,"",low,"Standard requirements;Basic security;User experience;Performance","General software practices","continue","software development best practices {date}","standard_requirements"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
project_type,detection_signals,key_questions,required_sections,skip_sections,web_search_triggers,innovation_signals
|
|
2
|
+
api_backend,"API,REST,GraphQL,backend,service,endpoints","Endpoints needed?;Authentication method?;Data formats?;Rate limits?;Versioning?;SDK needed?","endpoint_specs;auth_model;data_schemas;error_codes;rate_limits;api_docs","ux_ui;visual_design;user_journeys","framework best practices;OpenAPI standards","API composition;New protocol"
|
|
3
|
+
mobile_app,"iOS,Android,app,mobile,iPhone,iPad","Native or cross-platform?;Offline needed?;Push notifications?;Device features?;Store compliance?","platform_reqs;device_permissions;offline_mode;push_strategy;store_compliance","desktop_features;cli_commands","app store guidelines;platform requirements","Gesture innovation;AR/VR features"
|
|
4
|
+
saas_b2b,"SaaS,B2B,platform,dashboard,teams,enterprise","Multi-tenant?;Permission model?;Subscription tiers?;Integrations?;Compliance?","tenant_model;rbac_matrix;subscription_tiers;integration_list;compliance_reqs","cli_interface;mobile_first","compliance requirements;integration guides","Workflow automation;AI agents"
|
|
5
|
+
developer_tool,"SDK,library,package,npm,pip,framework","Language support?;Package managers?;IDE integration?;Documentation?;Examples?","language_matrix;installation_methods;api_surface;code_examples;migration_guide","visual_design;store_compliance","package manager best practices;API design patterns","New paradigm;DSL creation"
|
|
6
|
+
cli_tool,"CLI,command,terminal,bash,script","Interactive or scriptable?;Output formats?;Config method?;Shell completion?","command_structure;output_formats;config_schema;scripting_support","visual_design;ux_principles;touch_interactions","CLI design patterns;shell integration","Natural language CLI;AI commands"
|
|
7
|
+
web_app,"website,webapp,browser,SPA,PWA","SPA or MPA?;Browser support?;SEO needed?;Real-time?;Accessibility?","browser_matrix;responsive_design;performance_targets;seo_strategy;accessibility_level","native_features;cli_commands","web standards;WCAG guidelines","New interaction;WebAssembly use"
|
|
8
|
+
game,"game,player,gameplay,level,character","REDIRECT TO USE THE BMad Method Game Module Agent and Workflows - HALT","game-brief;GDD","most_sections","game design patterns","Novel mechanics;Genre mixing"
|
|
9
|
+
desktop_app,"desktop,Windows,Mac,Linux,native","Cross-platform?;Auto-update?;System integration?;Offline?","platform_support;system_integration;update_strategy;offline_capabilities","web_seo;mobile_features","desktop guidelines;platform requirements","Desktop AI;System automation"
|
|
10
|
+
iot_embedded,"IoT,embedded,device,sensor,hardware","Hardware specs?;Connectivity?;Power constraints?;Security?;OTA updates?","hardware_reqs;connectivity_protocol;power_profile;security_model;update_mechanism","visual_ui;browser_support","IoT standards;protocol specs","Edge AI;New sensors"
|
|
11
|
+
blockchain_web3,"blockchain,crypto,DeFi,NFT,smart contract","Chain selection?;Wallet integration?;Gas optimization?;Security audit?","chain_specs;wallet_support;smart_contracts;security_audit;gas_optimization","traditional_auth;centralized_db","blockchain standards;security patterns","Novel tokenomics;DAO structure"
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
export function guardrail(c) {
|
|
2
|
+
const a = c.apedDir;
|
|
3
|
+
const o = c.outputDir;
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
path: `${a}/hooks/guardrail.sh`,
|
|
7
|
+
executable: true,
|
|
8
|
+
content: `#!/usr/bin/env bash
|
|
9
|
+
# APED Guardrail — UserPromptSubmit hook
|
|
10
|
+
# Validates prompt coherence against pipeline state, existing artifacts, and memories.
|
|
11
|
+
# Returns JSON with "decision" and optionally "addToPrompt" to inject context.
|
|
12
|
+
|
|
13
|
+
set -euo pipefail
|
|
14
|
+
|
|
15
|
+
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
16
|
+
STATE_FILE="$PROJECT_ROOT/${a}/state.yaml"
|
|
17
|
+
CONFIG_FILE="$PROJECT_ROOT/${a}/config.yaml"
|
|
18
|
+
OUTPUT_DIR="$PROJECT_ROOT/${o}"
|
|
19
|
+
|
|
20
|
+
# Read stdin (JSON: {"session_id":"...","prompt":"..."})
|
|
21
|
+
INPUT=$(cat)
|
|
22
|
+
PROMPT=$(echo "$INPUT" | grep -o '"prompt":"[^"]*"' | sed 's/"prompt":"//;s/"$//' || echo "")
|
|
23
|
+
|
|
24
|
+
# If no prompt or empty, allow
|
|
25
|
+
if [[ -z "$PROMPT" ]]; then
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# ── Read current phase from state.yaml ──
|
|
30
|
+
CURRENT_PHASE="none"
|
|
31
|
+
if [[ -f "$STATE_FILE" ]]; then
|
|
32
|
+
CURRENT_PHASE=$(grep 'current_phase:' "$STATE_FILE" | sed 's/.*current_phase:[[:space:]]*"\\{0,1\\}\\([^"]*\\)"\\{0,1\\}/\\1/' | tr -d ' ' || echo "none")
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# ── Read communication language from config ──
|
|
36
|
+
LANG="english"
|
|
37
|
+
if [[ -f "$CONFIG_FILE" ]]; then
|
|
38
|
+
LANG=$(grep 'communication_language:' "$CONFIG_FILE" | sed 's/.*communication_language:[[:space:]]*//' | tr -d ' ' || echo "english")
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# ── Detect what the user is trying to do ──
|
|
42
|
+
PROMPT_LOWER=$(echo "$PROMPT" | tr '[:upper:]' '[:lower:]')
|
|
43
|
+
|
|
44
|
+
# Detect APED command invocations
|
|
45
|
+
WANTS_ANALYZE=false
|
|
46
|
+
WANTS_PRD=false
|
|
47
|
+
WANTS_EPICS=false
|
|
48
|
+
WANTS_DEV=false
|
|
49
|
+
WANTS_REVIEW=false
|
|
50
|
+
WANTS_ALL=false
|
|
51
|
+
WANTS_CODE=false
|
|
52
|
+
|
|
53
|
+
[[ "$PROMPT_LOWER" =~ (aped-a|/aped-a|analyze|analyse|research) ]] && WANTS_ANALYZE=true
|
|
54
|
+
[[ "$PROMPT_LOWER" =~ (aped-p|/aped-p|prd|product.req) ]] && WANTS_PRD=true
|
|
55
|
+
[[ "$PROMPT_LOWER" =~ (aped-e|/aped-e|epic|stories|story) ]] && WANTS_EPICS=true
|
|
56
|
+
[[ "$PROMPT_LOWER" =~ (aped-d|/aped-d|dev|implement|code|build|create.*component|create.*service) ]] && WANTS_DEV=true
|
|
57
|
+
[[ "$PROMPT_LOWER" =~ (aped-r|/aped-r|review|audit) ]] && WANTS_REVIEW=true
|
|
58
|
+
[[ "$PROMPT_LOWER" =~ (aped-all|/aped-all|full.pipeline|start.from.scratch) ]] && WANTS_ALL=true
|
|
59
|
+
[[ "$PROMPT_LOWER" =~ (code|implement|write.*function|create.*file|add.*feature|fix.*bug|refactor) ]] && WANTS_CODE=true
|
|
60
|
+
|
|
61
|
+
# ── Check artifact existence ──
|
|
62
|
+
HAS_BRIEF=false
|
|
63
|
+
HAS_PRD=false
|
|
64
|
+
HAS_EPICS=false
|
|
65
|
+
|
|
66
|
+
[[ -n "$(find "$OUTPUT_DIR" -name '*brief*' -o -name '*product-brief*' 2>/dev/null | head -1)" ]] && HAS_BRIEF=true
|
|
67
|
+
[[ -n "$(find "$OUTPUT_DIR" -name '*prd*' 2>/dev/null | head -1)" ]] && HAS_PRD=true
|
|
68
|
+
[[ -n "$(find "$OUTPUT_DIR" -name '*epic*' 2>/dev/null | head -1)" ]] && HAS_EPICS=true
|
|
69
|
+
|
|
70
|
+
# ── Phase-aware guardrail logic ──
|
|
71
|
+
WARNINGS=()
|
|
72
|
+
|
|
73
|
+
# Phase transition map: none → analyze → prd → epics → dev ↔ review → done
|
|
74
|
+
PHASE_ORDER="none analyze prd epics dev review done"
|
|
75
|
+
|
|
76
|
+
phase_index() {
|
|
77
|
+
local i=0
|
|
78
|
+
for p in $PHASE_ORDER; do
|
|
79
|
+
[[ "$p" == "$1" ]] && echo "$i" && return
|
|
80
|
+
i=$((i + 1))
|
|
81
|
+
done
|
|
82
|
+
echo "0"
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
CURRENT_IDX=$(phase_index "$CURRENT_PHASE")
|
|
86
|
+
|
|
87
|
+
# Rule 1: Trying to code without epics/stories
|
|
88
|
+
if [[ "$WANTS_CODE" == "true" || "$WANTS_DEV" == "true" ]] && [[ "$CURRENT_PHASE" != "dev" && "$CURRENT_PHASE" != "review" ]]; then
|
|
89
|
+
if [[ "$HAS_EPICS" == "false" ]]; then
|
|
90
|
+
WARNINGS+=("SKIP_DETECTED: Attempting dev/code without epics. Current phase: $CURRENT_PHASE. Run /aped-a → /aped-p → /aped-e first.")
|
|
91
|
+
elif [[ "$HAS_PRD" == "false" ]]; then
|
|
92
|
+
WARNINGS+=("SKIP_DETECTED: Attempting dev/code without PRD. Current phase: $CURRENT_PHASE. Run /aped-a → /aped-p first.")
|
|
93
|
+
fi
|
|
94
|
+
fi
|
|
95
|
+
|
|
96
|
+
# Rule 2: PRD without brief
|
|
97
|
+
if [[ "$WANTS_PRD" == "true" ]] && [[ "$HAS_BRIEF" == "false" ]] && [[ "$CURRENT_PHASE" != "prd" ]]; then
|
|
98
|
+
WARNINGS+=("MISSING_ARTIFACT: No product brief found. Run /aped-a first to generate the brief.")
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# Rule 3: Epics without PRD
|
|
102
|
+
if [[ "$WANTS_EPICS" == "true" ]] && [[ "$HAS_PRD" == "false" ]]; then
|
|
103
|
+
WARNINGS+=("MISSING_ARTIFACT: No PRD found. Run /aped-p first to generate the PRD.")
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
# Rule 4: Review without dev
|
|
107
|
+
if [[ "$WANTS_REVIEW" == "true" ]] && [[ "$CURRENT_PHASE" != "dev" && "$CURRENT_PHASE" != "review" ]]; then
|
|
108
|
+
WARNINGS+=("PREMATURE_REVIEW: No story has been developed yet. Run /aped-d first.")
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
# Rule 5: Trying to modify upstream artifacts during dev
|
|
112
|
+
if [[ "$CURRENT_PHASE" == "dev" || "$CURRENT_PHASE" == "review" ]]; then
|
|
113
|
+
if [[ "$WANTS_PRD" == "true" || "$WANTS_ANALYZE" == "true" ]]; then
|
|
114
|
+
WARNINGS+=("SCOPE_CHANGE: You are in phase '$CURRENT_PHASE'. Modifying the PRD/brief now will invalidate existing epics and stories. Use /aped-r with correct-course protocol instead.")
|
|
115
|
+
fi
|
|
116
|
+
fi
|
|
117
|
+
|
|
118
|
+
# Rule 6: Skipping phases
|
|
119
|
+
if [[ "$WANTS_DEV" == "true" ]] && [[ "$CURRENT_IDX" -lt 3 ]] && [[ "$WANTS_ALL" == "false" ]]; then
|
|
120
|
+
if [[ "$CURRENT_PHASE" == "none" || "$CURRENT_PHASE" == "analyze" ]]; then
|
|
121
|
+
WARNINGS+=("PHASE_SKIP: Jumping from '$CURRENT_PHASE' to dev skips critical pipeline steps. The pipeline ensures quality: Analyze → PRD → Epics → Dev.")
|
|
122
|
+
fi
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
# ── Build response ──
|
|
126
|
+
if [[ \${#WARNINGS[@]} -eq 0 ]]; then
|
|
127
|
+
# No issues, allow silently
|
|
128
|
+
exit 0
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
# Build the addToPrompt context
|
|
132
|
+
CONTEXT="[APED GUARDRAIL — Pipeline Coherence Check]\\n"
|
|
133
|
+
CONTEXT+="Current phase: $CURRENT_PHASE\\n"
|
|
134
|
+
CONTEXT+="Artifacts: brief=\${HAS_BRIEF}, prd=\${HAS_PRD}, epics=\${HAS_EPICS}\\n"
|
|
135
|
+
CONTEXT+="\\nWarnings detected:\\n"
|
|
136
|
+
|
|
137
|
+
for w in "\${WARNINGS[@]}"; do
|
|
138
|
+
CONTEXT+=" ⚠ $w\\n"
|
|
139
|
+
done
|
|
140
|
+
|
|
141
|
+
if [[ "$LANG" == "french" ]] || [[ "$LANG" == "français" ]]; then
|
|
142
|
+
CONTEXT+="\\nINSTRUCTION: Signale ces avertissements à l'utilisateur en français AVANT d'exécuter quoi que ce soit. Explique le problème et propose le chemin correct dans le pipeline. Demande confirmation si l'utilisateur veut quand même continuer."
|
|
143
|
+
else
|
|
144
|
+
CONTEXT+="\\nINSTRUCTION: Report these warnings to the user BEFORE executing anything. Explain the issue and suggest the correct pipeline path. Ask for confirmation if the user wants to proceed anyway."
|
|
145
|
+
fi
|
|
146
|
+
|
|
147
|
+
# Output JSON with addToPrompt — does not block, but injects context
|
|
148
|
+
printf '{"addToPrompt": "%s"}' "$CONTEXT"
|
|
149
|
+
`,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
path: `.claude/settings.local.json`,
|
|
153
|
+
content: `{
|
|
154
|
+
"hooks": {
|
|
155
|
+
"UserPromptSubmit": [
|
|
156
|
+
{
|
|
157
|
+
"matcher": "",
|
|
158
|
+
"hooks": [
|
|
159
|
+
{
|
|
160
|
+
"type": "command",
|
|
161
|
+
"command": "${a}/hooks/guardrail.sh"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`,
|
|
169
|
+
},
|
|
170
|
+
];
|
|
171
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { skills } from './skills.js';
|
|
2
|
+
import { scripts } from './scripts.js';
|
|
3
|
+
import { references } from './references.js';
|
|
4
|
+
import { configFiles } from './config.js';
|
|
5
|
+
import { commands } from './commands.js';
|
|
6
|
+
import { guardrail } from './guardrail.js';
|
|
7
|
+
|
|
8
|
+
export function getTemplates(config) {
|
|
9
|
+
return [
|
|
10
|
+
...configFiles(config),
|
|
11
|
+
...commands(config),
|
|
12
|
+
...skills(config),
|
|
13
|
+
...scripts(config),
|
|
14
|
+
...references(config),
|
|
15
|
+
...guardrail(config),
|
|
16
|
+
];
|
|
17
|
+
}
|